Upgrade AVIF decoding code

- Update to newer APIs.
 - Avoid manual pixel-by-pixel copy in favour of decoding directly to desired format & bit depth.
 - Avoid use-after-free by cloning the Uint8Array Wasm memory view into a JS-owned Uint8Array right away.
This commit is contained in:
Ingvar Stepanyan
2020-05-07 16:09:44 +01:00
parent 0ac3d17969
commit 2edb8cbd7e
5 changed files with 21 additions and 84 deletions

View File

@@ -15,6 +15,5 @@ export async function decode(data: ArrayBuffer): Promise<ImageData> {
rawImage.height,
);
module.free_result();
return result;
}