Repository navigation
image/gif: check rejection of this gif #3565
Copy link
Copy link
Closed
Labels
Description
Activity
This could be a feature. Now that I've looked at it in Chrome, I can't unsee that gif.
Labels changed: added priority-later, removed priority-triage.
Owner changed to @nigeltao.
Status changed to Accepted.
I looked into this a bit. I found that when the invalid code is found: code 639 litwidth 8 width 12 clear 256 eof 257 hi 90 ovf 4096 last 98 Because 639 < 90 (d.hi), it fails. I'll trace through another gif decoder and try to see what they do when receiving a code like this.
Another GIF that causes Go problems: https://bug525326.bugzilla.mozilla.org/attachment.cgi?id=409291 Don't know if it is the same problem yet, if not, I'll file a new bug.
I suspect this code in Webkit shows the way to making Go's gif decoder more lenient: http://trac.webkit.org/browser/trunk/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp?rev=131831#L322 More later.
A fix for this would involve making compress/lzw tolerant of incorrectly encoded streams. This seems like a bad idea in general. So a correct fix would need to add to the API of compress/lzw a boolean for "tolerate errors?". An API change to compress/lzw before Go 1.1 is not going to happen, so I think punting on this is the right call. The image in comment #7 is something else (issue #5050).
- locked and limited conversation to collaborators
on Jun 24, 2016
by kballard:
Attachments: