From e2440c250d94d64f8c70e596fe90808795aaa07e Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 18 May 2014 12:54:47 +0000 Subject: [PATCH] --- coders/png.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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]; -- 2.40.0