checking in fix for bug 155222 r=pavlov sr=tor@acm.org

This commit is contained in:
pavlov%netscape.com 2002-07-15 20:17:09 +00:00
parent 287b99fcf1
commit 6901cb0bbb
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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);