Commit a86505556 for imagemagick.org
commit a865055564cbf5983b34554e4230d4d8fc19e7cb
Author: Cristy <urban-warrior@imagemagick.org>
Date: Fri Jun 19 16:22:48 2026 -0400
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-99w2-r42q-g85v
diff --git a/coders/viff.c b/coders/viff.c
index 5730ca06a..23a41ebb4 100644
--- a/coders/viff.c
+++ b/coders/viff.c
@@ -334,10 +334,6 @@ static Image *ReadVIFFImage(const ImageInfo *image_info,
MAGICKCORE_QUANTUM_DEPTH;
image->alpha_trait=viff_info.number_data_bands == 4 ? BlendPixelTrait :
UndefinedPixelTrait;
- status=SetImageExtent(image,image->columns,image->rows,exception);
- if (status == MagickFalse)
- return(DestroyImageList(image));
- (void) SetImageBackgroundColor(image,exception);
/*
Verify that we can read this VIFF image.
*/
@@ -369,6 +365,10 @@ static Image *ReadVIFFImage(const ImageInfo *image_info,
ThrowReaderException(CoderError,"NumberOfImagesIsNotSupported");
if (viff_info.map_rows == 0)
viff_info.map_scheme=VFF_MS_NONE;
+ status=SetImageExtent(image,image->columns,image->rows,exception);
+ if (status == MagickFalse)
+ return(DestroyImageList(image));
+ (void) SetImageBackgroundColor(image,exception);
switch ((int) viff_info.map_scheme)
{
case VFF_MS_NONE: