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

Index: ImageMagick-6.8.8-1/coders/bmp.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/bmp.c	2019-07-17 22:07:00.108710487 +0200
+++ ImageMagick-6.8.8-1/coders/bmp.c	2019-07-17 22:07:00.292711521 +0200
@@ -1407,8 +1407,8 @@ static Image *ReadBMPImage(const ImageIn
         AcquireNextImage(image_info,image);
         if (GetNextImageInList(image) == (Image *) NULL)
           {
-            image=DestroyImageList(image);
-            return((Image *) NULL);
+            status=MagickFalse;
+            break;
           }
         image=SyncNextImageInList(image);
         status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
@@ -1418,6 +1418,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-6.8.8-1/coders/viff.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/viff.c	2019-07-17 22:06:59.440706733 +0200
+++ ImageMagick-6.8.8-1/coders/viff.c	2019-07-17 22:07:00.292711521 +0200
@@ -769,8 +769,8 @@ static Image *ReadVIFFImage(const ImageI
         AcquireNextImage(image_info,image);
         if (GetNextImageInList(image) == (Image *) NULL)
           {
-            image=DestroyImageList(image);
-            return((Image *) NULL);
+            status=MagickFalse;
+            break;
           }
         image=SyncNextImageInList(image);
         status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
@@ -780,6 +780,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