File ImageMagick-CVE-2019-12974.patch of Package ImageMagick

diff --git a/coders/pango.c b/coders/pango.c
index 0a3f320fd..43c2632b5 100644
--- a/coders/pango.c
+++ b/coders/pango.c
@@ -198,8 +198,11 @@ static Image *ReadPANGOImage(const ImageInfo *image_info,
       property=InterpretImageProperties(image_info,image,option+6);
     else
       property=InterpretImageProperties(image_info,image,option);
-  (void) SetImageProperty(image,"caption",property);
-  property=DestroyString(property);
+  if (property != (char *) NULL)
+    {
+      (void) SetImageProperty(image,"caption",property);
+      property=DestroyString(property);
+    }
   caption=ConstantString(GetImageProperty(image,"caption"));
   /*
     Get context.
diff --git a/coders/vid.c b/coders/vid.c
index 2ab75c6cf..6acf769af 100644
--- a/coders/vid.c
+++ b/coders/vid.c
@@ -176,8 +176,11 @@ static Image *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception)
     if (next_image == (Image *) NULL)
       break;
     label=InterpretImageProperties(image_info,next_image,DefaultTileLabel);
-    (void) SetImageProperty(next_image,"label",label);
-    label=DestroyString(label);
+    if (label != (char *) NULL)
+      {
+        (void) SetImageProperty(next_image,"label",label);
+        label=DestroyString(label);
+      }
     if (image_info->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "geometry: %.20gx%.20g",(double) next_image->columns,(double)

openSUSE Build Service is sponsored by