X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b02c8a11f0e0d284eff32cfde1fcd2a4b2e659d..27e6d746496f5a44c1fb062afc8f3f0f296808e6:/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;