From 4613eed4abfed048110dd687bae0b137765e3070 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 2 Jul 2018 20:19:53 -0400 Subject: [PATCH] ... --- coders/mpc.c | 4 ++-- coders/txt.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/coders/mpc.c b/coders/mpc.c index a118d2a83..1a32695ab 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -1011,8 +1011,8 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) AcquireNextImage(image_info,image,exception); if (GetNextImageInList(image) == (Image *) NULL) { - image=DestroyImageList(image); - return((Image *) NULL); + status=MagickFalse; + break; } image=SyncNextImageInList(image); status=SetImageProgress(image,LoadImagesTag,TellBlob(image), diff --git a/coders/txt.c b/coders/txt.c index 64aef8750..d464813bb 100644 --- a/coders/txt.c +++ b/coders/txt.c @@ -321,8 +321,8 @@ static Image *ReadTEXTImage(const ImageInfo *image_info, AcquireNextImage(image_info,image,exception); if (GetNextImageInList(image) == (Image *) NULL) { - image=DestroyImageList(image); - return((Image *) NULL); + status=MagickFalse; + break; } image->next->columns=image->columns; image->next->rows=image->rows; @@ -349,6 +349,8 @@ static Image *ReadTEXTImage(const ImageInfo *image_info, texture=DestroyImage(texture); draw_info=DestroyDrawInfo(draw_info); (void) CloseBlob(image); + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } -- 2.40.0