]> git.saurik.com Git - wxWidgets.git/blobdiff - src/png/example.c
large files support for wxFFile (patch 1077980 from Mike Wetherell)
[wxWidgets.git] / src / png / example.c
index fb1f5ed1d9be9b87fe03a563120abe22f7d24a87..ba0ecc5b5cc600464afee3ccebc557a76c517c9b 100644 (file)
@@ -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;