mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 06:08:02 +02:00
[cairo-png] Call png_set_filler() before png_read_update_info().
Otherwise libpng gets very confused and we start scribbling over invalid memory whilst reading in the PNG.
This commit is contained in:
parent
20b1b33c0f
commit
63bba7e60c
1 changed files with 2 additions and 1 deletions
|
|
@ -504,6 +504,8 @@ read_png (png_rw_ptr read_func,
|
|||
if (interlace != PNG_INTERLACE_NONE)
|
||||
png_set_interlace_handling (png);
|
||||
|
||||
png_set_filler (png, 0xff, PNG_FILLER_AFTER);
|
||||
|
||||
/* recheck header after setting EXPAND options */
|
||||
png_read_update_info (png, info);
|
||||
png_get_IHDR (png, info,
|
||||
|
|
@ -530,7 +532,6 @@ read_png (png_rw_ptr read_func,
|
|||
case PNG_COLOR_TYPE_RGB:
|
||||
format = CAIRO_FORMAT_RGB24;
|
||||
png_set_read_user_transform_fn (png, convert_bytes_to_data);
|
||||
png_set_filler (png, 0xff, PNG_FILLER_AFTER);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue