summaryrefslogtreecommitdiff
path: root/src/png.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2009-06-19 13:12:16 -0400
committerJorge Arellano Cid <jcid@dillo.org>2009-06-19 13:12:16 -0400
commit30ef110e2384e0ad26c2131b9d530f53954bcde9 (patch)
tree7e2b1f7698a756d0531ebc40711948a83b471ad7 /src/png.c
parenta68677c6ae0084be040ef0990a14e3a8aaaa690d (diff)
parentc1ff2a39f4abae6cf587df14a9754b98c1ccc0e3 (diff)
merge
Diffstat (limited to 'src/png.c')
-rw-r--r--src/png.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/png.c b/src/png.c
index c1257119..2184dd01 100644
--- a/src/png.c
+++ b/src/png.c
@@ -137,6 +137,12 @@ Png_datainfo_callback(png_structp png_ptr, png_infop info_ptr)
png_get_IHDR(png_ptr, info_ptr, &png->width, &png->height,
&bit_depth, &color_type, &interlace_type, NULL, NULL);
+ if (abs(png->width*png->height) > IMAGE_MAX_W * IMAGE_MAX_H) {
+ MSG("Png_datainfo_callback: suspicious image size request %ldx%ld\n",
+ png->width, png->height);
+ Png_error_handling(png_ptr, "Aborting...");
+ return; /* not reached */
+ }
_MSG("Png_datainfo_callback: png->width = %ld\n"
"Png_datainfo_callback: png->height = %ld\n",