File ImageMagick-CVE-2019-19948.patch of Package ImageMagick.23974
Index: ImageMagick-6.8.8-1/coders/sgi.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/sgi.c 2020-01-03 10:06:38.063430427 +0100
+++ ImageMagick-6.8.8-1/coders/sgi.c 2020-01-03 10:12:40.873373458 +0100
@@ -972,8 +972,6 @@ static MagickBooleanType WriteSGIImage(c
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- if ((image->columns > 65535UL) || (image->rows > 65535UL))
- ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
if (status == MagickFalse)
return(status);
@@ -983,6 +981,8 @@ static MagickBooleanType WriteSGIImage(c
/*
Initialize SGI raster file header.
*/
+ if ((image->columns > 65535UL) || (image->rows > 65535UL))
+ ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
(void) TransformImageColorspace(image,sRGBColorspace);
(void) ResetMagickMemory(&iris_info,0,sizeof(iris_info));