-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Index out of range" panic on decoding GIF files (both valid and malformed) #1238
Comments
This would be easily discovered by a fuzzer, FWIW. |
The problem seems to be that the image buffer passed to |
There are two different dimensions at play:
Similar thing happens in |
It seems to have no validation: https://github.com/image-rs/image-gif/blob/master/src/reader/decoder.rs#L333 No on to the spec to find if that is indeed forbidden. |
The spec says: "Each image must fit within the boundaries of the Logical Screen [...]". Where image is a frame, and the "Logical Screen" basically the overall gif image. The decoder allows checking for that with A potential fix seems easy enough. |
This happens in
image
from git, revision 092db1eExpected
Image decodes successfully or returns error, but doesn't panic.
Actual behaviour
When decoding the AFL-generated seed set for libgif,
image
panics on many of the images:Reproduction steps
panicking_afl_gif_testcases.tar.gz
The text was updated successfully, but these errors were encountered: