]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Thu, 14 Sep 2017 11:18:36 +0000 (07:18 -0400)
committerCristy <urban-warrior@imagemagick.org>
Thu, 14 Sep 2017 11:18:36 +0000 (07:18 -0400)
coders/raw.c

index b91282bb5af98524e13c36c70867e01479c64755..43cafa88d9749b4e5ee4109a5ee6dbe8e0524703 100644 (file)
@@ -178,6 +178,7 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
   scene=0;
   count=0;
   length=0;
+  status=MagickTrue;
   do
   {
     /*
@@ -208,6 +209,7 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
 
       if (count != (ssize_t) length)
         {
+          status=MagickFalse;
           ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
             image->filename);
           break;
@@ -278,6 +280,8 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
   quantum_info=DestroyQuantumInfo(quantum_info);
   canvas_image=DestroyImage(canvas_image);
   (void) CloseBlob(image);
+  if (status == MagickFalse)
+    return(DestroyImageList(image));
   return(GetFirstImageInList(image));
 }
 \f