X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..e1bdd5078c90d3813a815fc86ee3dd050b2ee1d3:/src/png/pngset.c?ds=sidebyside diff --git a/src/png/pngset.c b/src/png/pngset.c index aa85f24b6f..320083638c 100644 --- a/src/png/pngset.c +++ b/src/png/pngset.c @@ -1,12 +1,11 @@ /* pngset.c - storage of image information into info struct * - * libpng 1.0.1 + * libpng 1.0.3 - January 14, 1999 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1996, 1997 Andreas Dilger - * Copyright (c) 1998, Glenn Randers-Pehrson - * March 15, 1998 + * Copyright (c) 1998, 1999 Glenn Randers-Pehrson * * The functions here are used during reads to store data from the file * into the info struct, and during writes to store application data @@ -108,13 +107,14 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr, /* check for overflow */ rowbytes_per_pixel = (info_ptr->pixel_depth + 7) >> 3; - info_ptr->rowbytes = info_ptr->width * rowbytes_per_pixel; if (( width > (png_uint_32)2147483647L/rowbytes_per_pixel)) { png_warning(png_ptr, "Width too large to process image data; rowbytes will overflow."); info_ptr->rowbytes = (png_size_t)0; } + else + info_ptr->rowbytes = (info_ptr->width * info_ptr->pixel_depth + 7) >> 3; } #if defined(PNG_READ_oFFs_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED)