mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.2.2beta2.tar
This commit is contained in:
8
pngget.c
8
pngget.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* libpng 1.2.2beta1 - February 22, 2002
|
||||
* libpng 1.2.2beta2 - February 24, 2002
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -566,6 +566,10 @@ 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 == 0 || *width > PNG_MAX_UINT)
|
||||
png_error(png_ptr, "Invalid image width");
|
||||
if (height == 0 || *height > PNG_MAX_UINT)
|
||||
png_error(png_ptr, "Invalid image height");
|
||||
if ((*width > PNG_MAX_UINT/rowbytes_per_pixel))
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
|
||||
Reference in New Issue
Block a user