-
Notifications
You must be signed in to change notification settings - Fork 630
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
A possible crash with png_set_quantize and png_read_png #458
Comments
Here is the trigger case, you can compile it to reproduce the crash.
|
@thealberto hi, we have found some fresh crashes. That seems the Best regards. |
To quote the manual for png_read_png: "You must use png_transforms[the parameter to png_read_png] and not call any png_set_transform() functions when you use png_read_png." Here's a patch that detects the error. It uses png_app_error but if that is ignored it just zeros out the transformations. |
Hi,
when fuzzing, we found a crash happend when
png_read_png
followspng_set_quantize
.In
png_set_quantize
, it allocs the memory ofpng_ptr->quantize_index
with the size of parameternum_palette
.Then, in
png_read_png->png_read_image->png_read_row->png_do_read_transformations->png_do_quantize
, if the*sp
is greater thannum_palette
, an overflow and a crash will happen.The text was updated successfully, but these errors were encountered: