File ImageMagick-CVE-2026-23952.patch of Package ImageMagick.42529

From 1eefab41bc0ab1c6c2c1fd3e4a49e3ee1849751d Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Thu, 15 Jan 2026 17:34:46 -0500
Subject: [PATCH] 
 https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-5vx3-wx4q-6cj8

---
 PerlMagick/quantum/quantum.pm |  2 +-
 coders/msl.c                  | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

Index: ImageMagick-7.1.1-21/PerlMagick/quantum/quantum.pm
===================================================================
--- ImageMagick-7.1.1-21.orig/PerlMagick/quantum/quantum.pm
+++ ImageMagick-7.1.1-21/PerlMagick/quantum/quantum.pm
@@ -6,7 +6,7 @@ package Image::Magick::Q16HDRI;
 #  You may not use this file except in compliance with the License.  You may
 #  obtain a copy of the License at
 #
-#    https://imagemagick.org/script/license.php
+#    https://imagemagick.org/license/
 #
 #  Unless required by applicable law or agreed to in writing, software
 #  distributed under the License is distributed on an "AS IS" BASIS,
Index: ImageMagick-7.1.1-21/coders/msl.c
===================================================================
--- ImageMagick-7.1.1-21.orig/coders/msl.c
+++ ImageMagick-7.1.1-21/coders/msl.c
@@ -7400,6 +7400,12 @@ static void MSLEndElement(void *context,
     {
       if (LocaleCompare((const char *) tag,"comment") == 0 )
         {
+          if (msl_info->image[n] == (Image *) NULL)
+            {
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
+              break;
+            }
           (void) DeleteImageProperty(msl_info->image[n],"comment");
           if (msl_info->content == (char *) NULL)
             break;
@@ -7449,6 +7455,12 @@ static void MSLEndElement(void *context,
     {
       if (LocaleCompare((const char *) tag,"label") == 0 )
         {
+          if (msl_info->image[n] == (Image *) NULL)
+            {
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
+              break;
+            }
           (void) DeleteImageProperty(msl_info->image[n],"label");
           if (msl_info->content == (char *) NULL)
             break;
openSUSE Build Service is sponsored by