From 5def1e993fef731a151b08afa08f9bcab7b1071b Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 1 Jun 2018 18:26:05 -0400 Subject: [PATCH] ... --- coders/png.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coders/png.c b/coders/png.c index cc9693fa4..8b78bdf7c 100644 --- a/coders/png.c +++ b/coders/png.c @@ -4970,13 +4970,15 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, { assert(color_image == (Image *) NULL); assert(alpha_image == (Image *) NULL); + if (color_image != (Image *) NULL) + color_image=DestroyImageList(color_image); return(DestroyImageList(image)); } if (color_image == (Image *) NULL) { assert(alpha_image == (Image *) NULL); - return(DestroyImageList(image)); + ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); } (void) SeekBlob(color_image,0,SEEK_SET); -- 2.40.0