File ImageMagick-CVE-2022-1115.patch of Package ImageMagick
iff --git a/coders/tiff.c b/coders/tiff.c
index 8fd1451c8..b8d7b88b8 100644
Index: ImageMagick-7.1.0-9/coders/tiff.c
===================================================================
--- ImageMagick-7.1.0-9.orig/coders/tiff.c
+++ ImageMagick-7.1.0-9/coders/tiff.c
@@ -2000,7 +2000,12 @@ static Image *ReadTIFFImage(const ImageI
number_pixels=(MagickSizeType) columns*rows;
if (HeapOverflowSanityCheck(rows,sizeof(*tile_pixels)) != MagickFalse)
ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
- extent=MagickMax(rows*TIFFTileRowSize(tiff),TIFFTileSize(tiff));
+ extent=4*MagickMax(rows*TIFFTileRowSize(tiff),TIFFTileSize(tiff));
+#if defined(TIFF_VERSION_BIG)
+ extent+=image->columns*sizeof(uint64);
+#else
+ extent+=image->columns*sizeof(uint32);
+#endif
tile_pixels=(unsigned char *) AcquireQuantumMemory(extent,
sizeof(*tile_pixels));
if (tile_pixels == (unsigned char *) NULL)