File ImageMagick-CVE-2019-16711.patch of Package ImageMagick.30356

Index: ImageMagick-7.0.7-34/coders/ps2.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/ps2.c	2019-10-08 13:39:36.296397673 +0200
+++ ImageMagick-7.0.7-34/coders/ps2.c	2019-10-08 13:48:53.019171990 +0200
@@ -203,19 +203,19 @@ static MagickBooleanType Huffman2DEncode
   unsigned char
     *group4;
 
-  status=MagickTrue;
-  write_info=CloneImageInfo(image_info);
-  (void) CopyMagickString(write_info->filename,"GROUP4:",MagickPathExtent);
-  (void) CopyMagickString(write_info->magick,"GROUP4",MagickPathExtent);
   group4_image=CloneImage(inject_image,0,0,MagickTrue,exception);
   if (group4_image == (Image *) NULL)
     return(MagickFalse);
+  write_info=CloneImageInfo(image_info);
+  (void) CopyMagickString(write_info->filename,"GROUP4:",MagickPathExtent);
+  (void) CopyMagickString(write_info->magick,"GROUP4",MagickPathExtent);
   group4=(unsigned char *) ImageToBlob(write_info,group4_image,&length,
     exception);
+  write_info=DestroyImageInfo(write_info);
   group4_image=DestroyImage(group4_image);
   if (group4 == (unsigned char *) NULL)
     return(MagickFalse);
-  write_info=DestroyImageInfo(write_info);
+  status=MagickTrue;
   if (WriteBlob(image,length,group4) != (ssize_t) length)
     status=MagickFalse;
   group4=(unsigned char *) RelinquishMagickMemory(group4);
openSUSE Build Service is sponsored by