File GraphicsMagick-CVE-2017-11640.patch of Package GraphicsMagick.7782

Index: GraphicsMagick-1.3.25/coders/pwp.c
===================================================================
--- GraphicsMagick-1.3.25.orig/coders/pwp.c	2017-11-29 11:12:52.000229612 +0100
+++ GraphicsMagick-1.3.25/coders/pwp.c	2017-11-29 11:13:18.648676599 +0100
@@ -235,10 +235,12 @@ static Image *ReadPWPImage(const ImageIn
       break;
   }
   DestroyImageInfo(clone_info);
-  if (EOFBlob(image))
-    ThrowException(exception,CorruptImageError,UnexpectedEndOfFile,
-      image->filename);
-  CloseBlob(image);
+  if (image) {
+    if (EOFBlob(image))
+      ThrowException(exception,CorruptImageError,UnexpectedEndOfFile,
+        image->filename);
+    CloseBlob(image);
+  }
   return(image);
 }
 
openSUSE Build Service is sponsored by