X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b02c8a11f0e0d284eff32cfde1fcd2a4b2e659d..2b0246530d08cf7724d94c70d631c166f9717c2c:/src/png/example.c diff --git a/src/png/example.c b/src/png/example.c index fb1f5ed1d9..ba0ecc5b5c 100644 --- a/src/png/example.c +++ b/src/png/example.c @@ -742,6 +742,9 @@ void write_png(char *file_name /* , ... other image information ... */) png_byte image[height][width*bytes_per_pixel]; png_bytep row_pointers[height]; + if (height > PNG_UINT_32_MAX/png_sizeof(png_bytep)) + png_error (png_ptr, "Image is too tall to process in memory"); + for (k = 0; k < height; k++) row_pointers[k] = image + k*width*bytes_per_pixel;