From: dirk Date: Sun, 7 Sep 2014 08:57:02 +0000 (+0000) Subject: Fixed skipping tiff directory when reading sub image. X-Git-Tag: 7.0.1-0~2037 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e380de9b371558ce78d6db9b8640235a052efc71;p=imagemagick Fixed skipping tiff directory when reading sub image. --- diff --git a/coders/tiff.c b/coders/tiff.c index 28b91f9a7..fab4ceb0a 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -999,10 +999,17 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, */ for (i=0; i < (ssize_t) image_info->scene; i++) { - (void) TIFFReadDirectory(tiff); + status=TIFFReadDirectory(tiff) != 0 ? MagickTrue : MagickFalse; + if (status == MagickFalse) + { + TIFFClose(tiff); + image=DestroyImageList(image); + return((Image *) NULL); + } AcquireNextImage(image_info,image,exception); if (GetNextImageInList(image) == (Image *) NULL) { + TIFFClose(tiff); image=DestroyImageList(image); return((Image *) NULL); }