Commit 5ac09367d for imagemagick.org

commit 5ac09367d012d6f532990d03324f838e50e5a2e3
Author: Cristy <urban-warrior@imagemagick.org>
Date:   Wed Oct 21 17:56:27 2026 -0400

    https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-mf84-8w53-2f2c

diff --git a/coders/msl.c b/coders/msl.c
index 7caeec16b..6c4d544ac 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -1641,6 +1641,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                       if ((property != (const char *) NULL)  &&
                           (LocaleCompare(property,value) == 0))
                         {
+                          if (msl_info->image[j] == (Image *) NULL)
+                            break;
                           SetImageType(composite_image,TrueColorAlphaType,
                             exception);
                           (void) CompositeImage(composite_image,
@@ -1816,7 +1818,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               rotate_image=DestroyImageList(rotate_image);
             }
           (void) SetImageChannelMask(image,channel_mask);
-          composite_image=DestroyImageList(composite_image);
+          composite_image=DestroyImage(composite_image);
           break;
         }
       if (LocaleCompare((const char *) tag,"contrast") == 0)
@@ -3378,6 +3380,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                       if ((prop != (const char *) NULL)  &&
                           (LocaleCompare(prop,value) == 0))
                         {
+                          if (msl_info->image[j] == (Image *) NULL)
+                            break;
                           affinity_image=CloneImage(msl_info->image[j],0,0,
                             MagickFalse,exception);
                           break;
@@ -3400,7 +3404,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               (void) RemapImages(quantize_info,msl_info->image[n],
                 affinity_image,exception);
-              affinity_image=DestroyImageList(affinity_image);
+              affinity_image=DestroyImage(affinity_image);
             }
           quantize_info=DestroyQuantizeInfo(quantize_info);
           break;