File ImageMagick-CVE-2019-13133,13134.patch of Package ImageMagick.30356

Index: ImageMagick-7.0.7-34/coders/bmp.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/bmp.c	2019-07-17 21:47:37.926126345 +0200
+++ ImageMagick-7.0.7-34/coders/bmp.c	2019-07-17 21:54:06.752328410 +0200
@@ -1459,8 +1459,8 @@ static Image *ReadBMPImage(const ImageIn
         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),
@@ -1470,6 +1470,8 @@ static Image *ReadBMPImage(const ImageIn
       }
   } while (IsBMP(magick,2) != MagickFalse);
   (void) CloseBlob(image);
+  if (status == MagickFalse)
+    return(DestroyImageList(image));
   return(GetFirstImageInList(image));
 }
 
Index: ImageMagick-7.0.7-34/coders/viff.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/viff.c	2018-05-20 17:55:43.000000000 +0200
+++ ImageMagick-7.0.7-34/coders/viff.c	2019-07-17 21:55:07.800674339 +0200
@@ -771,8 +771,8 @@ static Image *ReadVIFFImage(const ImageI
         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),
@@ -782,6 +782,8 @@ static Image *ReadVIFFImage(const ImageI
       }
   } while ((count != 0) && (viff_info.identifier == 0xab));
   (void) CloseBlob(image);
+  if (status == MagickFalse)
+    return(DestroyImageList(image));
   return(GetFirstImageInList(image));
 }
 
openSUSE Build Service is sponsored by