You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running coalesce inside readCollection on a huge GIF causes the native module to throw a memory access out of bounds exception
VM2835:1 Error processing GIF: RuntimeError: memory access out of bounds
at magick.dfc94ac5f18be68f99c9.wasm:0x8f67
at magick.dfc94ac5f18be68f99c9.wasm:0x2809f3
at magick.dfc94ac5f18be68f99c9.wasm:0x80938
at magick.dfc94ac5f18be68f99c9.wasm:0x151a9d
at magick.dfc94ac5f18be68f99c9.wasm:0x384918
at magick.dfc94ac5f18be68f99c9.wasm:0x8e91f3
at e._MagickImageCollection_Coalesce (magick.js:8:1)
at magick-image-collection.ts:439:1
at magick-image-collection.ts:811:1
at exception.ts:39:1
at Ge.use (int-pointer.ts:18:1)
at T.use (exception.ts:38:1)
at magick-image-collection.ts:809:1
at Me.attachImages (magick-image-collection.ts:729:1)
at Me.replaceImages (magick-image-collection.ts:809:1)
at Me.coalesce (magick-image-collection.ts:439:1)
Steps to Reproduce
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8" />
<metaname="viewport" content="width=device-width, initial-scale=1.0" />
<title>ImageMagick WASM Demo</title></head><body><h1>Upload a GIF File</h1><inputtype="file" id="fileInput" accept="image/gif" />
<divid="output"></div><scripttype="module">import{ImageMagick,MagickFormat,initializeImageMagick}from"https://esm.sh/@imagemagick/[email protected]/dist/index.mjs";// Initializeasyncfunctionstart(){try{constwasmUrl="https://esm.sh/@imagemagick/[email protected]/dist/magick.wasm";constwasmBinary=awaitfetch(wasmUrl).then(response=>response.arrayBuffer());awaitinitializeImageMagick(wasmBinary);constfileInput=document.getElementById('fileInput');fileInput.addEventListener('change',async(event)=>{constfile=event.target.files[0];if(file){constarrayBuffer=awaitfile.arrayBuffer();constuint8Array=newUint8Array(arrayBuffer);// Wait for the ImageMagick WASM module to initializeImageMagick.readCollection(uint8Array,MagickFormat.Gif,(images)=>{images.coalesce();// Process images with coalesce});}});}catch(error){console.error("Failed to initialize ImageMagick:",error);}}start();</script></body></html>
Format : GIF
Format/Info : Graphics Interchange Format
File size : 90.7 MiB
Image
Format : GIF
Format/Info : Graphics Interchange Format
Format profile : 89a
Width : 1 331 pixels
Height : 1 331 pixels
Compression mode : Lossless
The GIF has 201 frames as read by ImageMagick.readCollection
The text was updated successfully, but these errors were encountered:
geocine
changed the title
RuntimeError: memory access out of bounds on CoalesceImages
RuntimeError: memory access out of bounds on _MagickImageCollection_Coalesce
Aug 24, 2024
magick-wasm version
0.0.30
Description
Running coalesce inside readCollection on a huge GIF causes the native module to throw a memory access out of bounds exception
Steps to Reproduce
Images
https://drive.google.com/file/d/1jeToienatAO07jRmZYpLMlK0MJgBFUcx/view?usp=sharing
This is a zipped file with the GIF image used.
The GIF has 201 frames as read by
ImageMagick.readCollection
The text was updated successfully, but these errors were encountered: