summaryrefslogtreecommitdiff
path: root/coders/gif.c
diff options
context:
space:
mode:
Diffstat (limited to 'coders/gif.c')
-rw-r--r--coders/gif.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/coders/gif.c b/coders/gif.c
index 21de0823c..701ffd58b 100644
--- a/coders/gif.c
+++ b/coders/gif.c
@@ -1238,12 +1238,8 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception)
AcquireNextImage(image_info,image,exception);
if (GetNextImageInList(image) == (Image *) NULL)
{
- if (profiles != (LinkedListInfo *) NULL)
- profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
- image=DestroyImageList(image);
- global_colormap=(unsigned char *) RelinquishMagickMemory(
- global_colormap);
- return((Image *) NULL);
+ status=MagickFalse;
+ break;
}
image=SyncNextImageInList(image);
}
@@ -1393,6 +1389,8 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception)
if ((image->columns == 0) || (image->rows == 0))
ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize");
(void) CloseBlob(image);
+ if (status == MagickFalse)
+ return(DestroyImageList(image));
return(GetFirstImageInList(image));
}