From: cristy Date: Sun, 18 May 2014 12:54:47 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2319 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2440c250d94d64f8c70e596fe90808795aaa07e;p=imagemagick --- diff --git a/coders/png.c b/coders/png.c index aa074359d..c51b96a64 100644 --- a/coders/png.c +++ b/coders/png.c @@ -4357,9 +4357,11 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, if (length == 16) { jng_width=(size_t) ((p[0] << 24) | (p[1] << 16) | - (p[2] << 8) | p[3]); + (p[2] << 8) | p[3]); jng_height=(size_t) ((p[4] << 24) | (p[5] << 16) | - (p[6] << 8) | p[7]); + (p[6] << 8) | p[7]); + if ((jng_width == 0) || (jng_height == 0)) + ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize"); jng_color_type=p[8]; jng_image_sample_depth=p[9]; jng_image_compression_method=p[10];