From: Cristy Date: Tue, 1 May 2018 23:54:38 +0000 (-0400) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8109 X-Git-Tag: 7.0.7-30~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=730f1d1d3ebe92b46bfce8a06c04c1517edee6dc;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8109 --- diff --git a/coders/tiff.c b/coders/tiff.c index 0f84a4238..e763f0522 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1362,8 +1362,10 @@ DisableMSCWarning(4127) if (0 && (image_info->verbose != MagickFalse)) TIFFPrintDirectory(tiff,stdout,MagickFalse); RestoreMSCWarning + photometric=PHOTOMETRIC_RGB; if ((TIFFGetField(tiff,TIFFTAG_IMAGEWIDTH,&width) != 1) || (TIFFGetField(tiff,TIFFTAG_IMAGELENGTH,&height) != 1) || + (TIFFGetFieldDefaulted(tiff,TIFFTAG_PHOTOMETRIC,&photometric) != 1) || (TIFFGetFieldDefaulted(tiff,TIFFTAG_COMPRESSION,&compress_tag) != 1) || (TIFFGetFieldDefaulted(tiff,TIFFTAG_FILLORDER,&endian) != 1) || (TIFFGetFieldDefaulted(tiff,TIFFTAG_PLANARCONFIG,&interlace) != 1) || @@ -1376,8 +1378,6 @@ RestoreMSCWarning TIFFClose(tiff); ThrowReaderException(CorruptImageError,"ImproperImageHeader"); } - photometric=PHOTOMETRIC_RGB; - (void) TIFFGetFieldDefaulted(tiff,TIFFTAG_PHOTOMETRIC,&photometric); if (sample_format == SAMPLEFORMAT_IEEEFP) (void) SetImageProperty(image,"quantum:format","floating-point", exception);