File ImageMagick-CVE-2019-13310.patch of Package ImageMagick.19143

Index: ImageMagick-6.8.8-1/wand/mogrify.c
===================================================================
--- ImageMagick-6.8.8-1.orig/wand/mogrify.c	2019-07-23 13:01:03.068280652 +0200
+++ ImageMagick-6.8.8-1/wand/mogrify.c	2019-07-23 13:01:40.536502460 +0200
@@ -7666,6 +7666,8 @@ WandExport MagickBooleanType MogrifyImag
               channel,metric,&distortion,exception);
             if (difference_image == (Image *) NULL)
               break;
+            reconstruct_image=DestroyImage(reconstruct_image);
+            image=DestroyImage(image);
             if (*images != (Image *) NULL)
               *images=DestroyImage(*images);
             *images=difference_image;
@@ -7977,6 +7979,7 @@ WandExport MagickBooleanType MogrifyImag
                    q=GetImageFromList(*images,index-1);
                    if (q == (Image *) NULL)
                      {
+                       p=DestroyImage(p);
                        (void) ThrowMagickException(exception,GetMagickModule(),
                          OptionError,"NoSuchImage","`%s'",argv[i+1]);
                        status=MagickFalse;
openSUSE Build Service is sponsored by