Commit b68a31840 for imagemagick.org
commit b68a31840b0617e475c8af0785de1504b9fd0ef4
Author: Cristy <urban-warrior@imagemagick.org>
Date: Sat Feb 28 10:12:24 2026 -0500
https://github.com/ImageMagick/ImageMagick/issues/8584
diff --git a/coders/heic.c b/coders/heic.c
index e3ccbce31..ed1e4048d 100644
--- a/coders/heic.c
+++ b/coders/heic.c
@@ -1482,6 +1482,8 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
SetGeometryInfo(&cicp);
nclx_profile=heif_nclx_color_profile_alloc();
+ if (nclx_profile == (struct heif_color_profile_nclx *) NULL)
+ ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
cicp.rho=(double) nclx_profile->color_primaries;
cicp.sigma=(double) nclx_profile->transfer_characteristics;
cicp.xi=(double) nclx_profile->matrix_coefficients;