From 379e21cd32483df6e128147af3bc4ce1f82eb9c4 Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 5 Jan 2017 12:09:24 -0500 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31161 --- ChangeLog | 4 ++++ coders/tiff.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5da27f3b1..03739301c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-01-04 7.0.4-3 Cristy + * Increase memory allocation for TIFF pixels (reference + https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31161). + 2017-01-03 7.0.4-2 Cristy * Release ImageMagick version 7.0.4-2, GIT revision 19318:8766311:20170103. diff --git a/coders/tiff.c b/coders/tiff.c index a8e40e25f..a3c6a4a79 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1608,8 +1608,9 @@ RestoreMSCWarning method=ReadTileMethod; quantum_info->endian=LSBEndian; quantum_type=RGBQuantum; - tiff_pixels=(unsigned char *) AcquireMagickMemory(TIFFScanlineSize(tiff)+ - sizeof(uint32)); + tiff_pixels=(unsigned char *) AcquireMagickMemory(MagickMax( + TIFFScanlineSize(tiff),(size_t) (image->columns*samples_per_pixel* + pow(2.0,ceil(log(bits_per_sample)/log(2.0)))))); if (tiff_pixels == (unsigned char *) NULL) { TIFFClose(tiff); -- 2.40.0