Commit d1402c213 for imagemagick.org

commit d1402c213c06d06f2e006e9ff433050774093677
Author: Cristy <urban-warrior@imagemagick.org>
Date:   Tue Oct 6 06:41:51 2026 -0400

    https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-h3qx-937j-245g

diff --git a/coders/uhdr.c b/coders/uhdr.c
index 8bfe26dda..b5387482a 100644
--- a/coders/uhdr.c
+++ b/coders/uhdr.c
@@ -242,6 +242,14 @@ static Image *ReadUHDRImage(const ImageInfo *image_info,
       return(GetFirstImageInList(image));
     }

+  status=SetImageExtent(image,image->columns,image->rows,exception);
+  if (status == MagickFalse)
+    {
+      uhdr_release_decoder(handle);
+      CloseBlob(image);
+      return(DestroyImageList(image));
+    }
+
   CHECK_IF_ERR(uhdr_decode(handle))

   uhdr_raw_image_t
@@ -294,14 +302,6 @@ static Image *ReadUHDRImage(const ImageInfo *image_info,
     }
   }

-  status=SetImageExtent(image,image->columns,image->rows,exception);
-  if (status == MagickFalse)
-    {
-      uhdr_release_decoder(handle);
-      CloseBlob(image);
-      return(DestroyImageList(image));
-    }
-
 #undef CHECK_IF_ERR

   uhdr_mem_block_t *exif = uhdr_dec_get_exif(handle);