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
{{ message }}
Repository navigation
Fail to Load a Gif Image with v2.0.0 but works with v1.0.4 on the same machine. #2012
Confirmed. Memory access violation in LzwDecoder. Will compare GifDecoderCore in 1.0.4 with the one from main to see what I can spot. It's likely got something to do with our new XMP functionality as I've already checked the missing colortable fix.
It's definitely the XMP application extension handling. I've fixed the reader so far but it looks like the writer does not match the specification also and is not writing the data in subblocks..
Here is another gif file which even fails the v1.0.4
That image is actually corrupt. The minimum code specified is greater than the specification allows.
Windows Explorer can't open it, nor can Photos, Paint, or Paint.NET.
Edge can though, as can VS Code, returning it as a 276 x 49135 transparent gif which is actually incorrect according to the specification because there's no Graphic Control Extension present in the image and thus no transparency flag.
I can update the decoder to simply ignore frame indices data if it's corrupt. This will return a 276 x 49135 black gif.
From time to time, corrupted image would be encountered. The main problem is that an unmanaged exception would be thrown and the process would be terminated. Is it possible to catch the unmanaged exception and throw a managed one so that the situation could be handled in the C# code ?
Activity
JimBobSquarePants commentedon Feb 18, 2022
Confirmed. Memory access violation in
LzwDecoder. Will compareGifDecoderCorein 1.0.4 with the one from main to see what I can spot. It's likely got something to do with our new XMP functionality as I've already checked the missing colortable fix.JimBobSquarePants commentedon Feb 18, 2022
It's definitely the XMP application extension handling. I've fixed the reader so far but it looks like the writer does not match the specification also and is not writing the data in subblocks..
Handle empty XMP profiles. Fix #2012
paulyipkh commentedon Feb 19, 2022
Here is another gif file which even fails the v1.0.4 https://www.rxlist.com/images/rxlist/drona1.gif
JimBobSquarePants commentedon Feb 19, 2022
That image is actually corrupt. The minimum code specified is greater than the specification allows.
Windows Explorer can't open it, nor can Photos, Paint, or Paint.NET.
Edge can though, as can VS Code, returning it as a 276 x 49135 transparent gif which is actually incorrect according to the specification because there's no Graphic Control Extension present in the image and thus no transparency flag.
I can update the decoder to simply ignore frame indices data if it's corrupt. This will return a 276 x 49135 black gif.
paulyipkh commentedon Feb 19, 2022
From time to time, corrupted image would be encountered. The main problem is that an unmanaged exception would be thrown and the process would be terminated. Is it possible to catch the unmanaged exception and throw a managed one so that the situation could be handled in the C# code ?
JimBobSquarePants commentedon Feb 19, 2022
Did you read the referenced PR?