mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
checking in fix for bug 155222 r=pavlov sr=tor@acm.org
This commit is contained in:
parent
287b99fcf1
commit
6901cb0bbb
@ -17,3 +17,5 @@ Bug 135579 - small interlaced PNG images not decoded correctly.
|
||||
Bug 154996 - PNG files with invalid IHDR can crash/hand browser.
|
||||
Affected files: pngpread.c
|
||||
|
||||
Bug 155222 - PNG files with invalid IHDR can corrupt heap.
|
||||
Affected files: pngget.c
|
||||
|
@ -566,9 +566,9 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
|
||||
channels++;
|
||||
pixel_depth = *bit_depth * channels;
|
||||
rowbytes_per_pixel = (pixel_depth + 7) >> 3;
|
||||
if ((*width > PNG_MAX_UINT/rowbytes_per_pixel))
|
||||
if (*width > PNG_MAX_UINT/rowbytes_per_pixel - 64)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
png_error(png_ptr,
|
||||
"Width too large for libpng to process image data.");
|
||||
}
|
||||
return (1);
|
||||
|
Loading…
Reference in New Issue
Block a user