Commit 5bff96a5c for imagemagick.org

commit 5bff96a5c8d0b3dafa4ad4fa7916db4cae72a11d
Author: Cristy <urban-warrior@imagemagick.org>
Date:   Tue Aug 4 18:46:51 2026 -0400

    https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-chf5-8rv9-gjqr

diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs
index 34dc5ad01..0cd89e492 100644
--- a/PerlMagick/Magick.xs
+++ b/PerlMagick/Magick.xs
@@ -7270,7 +7270,7 @@ Layers(ref,...)
         /*
           Split image sequence at the first 'NULL:' image.
         */
-        source=image;
+        source=CloneImageList(image,exception);
         while (source != (Image *) NULL)
         {
           source=GetNextImageInList(source);
diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in
index 1e0da349e..d874b9be2 100644
--- a/PerlMagick/quantum/quantum.xs.in
+++ b/PerlMagick/quantum/quantum.xs.in
@@ -7287,7 +7287,7 @@ Layers(ref,...)
         /*
           Split image sequence at the first 'NULL:' image.
         */
-        source=image;
+        source=CloneImageList(image,exception);
         while (source != (Image *) NULL)
         {
           source=GetNextImageInList(source);