summaryrefslogtreecommitdiff
path: root/coders/tim.c
diff options
context:
space:
mode:
Diffstat (limited to 'coders/tim.c')
-rw-r--r--coders/tim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/coders/tim.c b/coders/tim.c
index afccbc927..cb557b837 100644
--- a/coders/tim.c
+++ b/coders/tim.c
@@ -419,8 +419,8 @@ static Image *ReadTIMImage(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),
@@ -430,6 +430,8 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception)
}
} while (tim_info.id == 0x00000010);
(void) CloseBlob(image);
+ if (status == MagickFalse)
+ return(DestroyImageList(image));
return(GetFirstImageInList(image));
}