]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1562
authorCristy <mikayla-grace@urban-warrior.org>
Mon, 29 Apr 2019 12:09:34 +0000 (08:09 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Mon, 29 Apr 2019 12:09:34 +0000 (08:09 -0400)
coders/sgi.c

index 236bf4cb91d54ac1d0b2bb21a6fed1c6cd95bdde..415598122c89ba6443a03c9bd6ee3193141d533c 100644 (file)
@@ -953,8 +953,6 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image,
   assert(image->signature == MagickCoreSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  if ((image->columns > 65535UL) || (image->rows > 65535UL))
-    ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickCoreSignature);
   status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
@@ -967,6 +965,8 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image,
     /*
       Initialize SGI raster file header.
     */
+    if ((image->columns > 65535UL) || (image->rows > 65535UL))
+      ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
     (void) memset(&iris_info,0,sizeof(iris_info));
     iris_info.magic=0x01DA;