]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Tue, 18 Jun 2019 17:49:26 +0000 (13:49 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 18 Jun 2019 17:49:26 +0000 (13:49 -0400)
coders/tiff.c

index 97402f2cb37c11e280b248d9f5096d7b4ee0375d..c476e90dd47fbc6fd438a239bd1edcf17bf0f914 100644 (file)
@@ -3618,7 +3618,8 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
     }
   mode=endian_type == LSBEndian ? "wl" : "wb";
 #if defined(TIFF_VERSION_BIG)
-  if (LocaleCompare(image_info->magick,"TIFF64") == 0)
+  if ((LocaleCompare(image_info->magick,"TIFF64") == 0) ||
+      (((MagickOffsetType) image->columns*image->rows) > SSIZE_MAX))
     mode=endian_type == LSBEndian ? "wl8" : "wb8";
 #endif
   tiff=TIFFClientOpen(image->filename,mode,(thandle_t) image,TIFFReadBlob,