]> granicus.if.org Git - imagemagick/commitdiff
Check for image list before we destroy the last image in XCF coder (patch sent privat...
authorCristy <urban-warrior@imagemagick.org>
Thu, 9 Feb 2017 23:10:43 +0000 (18:10 -0500)
committerCristy <urban-warrior@imagemagick.org>
Thu, 9 Feb 2017 23:10:43 +0000 (18:10 -0500)
coders/xcf.c

index 8098cd82f4aa150be0a3e982d48e4efe310ab28a..abac48e2542066f5a639d1b99ff2a9c8e83c47a1 100644 (file)
@@ -1422,7 +1422,8 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception)
   }
 
   (void) CloseBlob(image);
-  DestroyImage(RemoveFirstImageFromList(&image));
+  if (GetNextImageInList(image) != (Image *) NULL)
+    DestroyImage(RemoveFirstImageFromList(&image));
   if (image_type == GIMP_GRAY)
     image->type=GrayscaleType;
   return(GetFirstImageInList(image));