From 97cce5ba832498120ea0037c67b9fe8221c4548f Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 25 Apr 2017 19:09:02 -0700 Subject: [PATCH] tiffdec: only request EXTRASAMPLES w/> 3 samples/px Change-Id: I820e7de34e500c42ab51c97a70f25319807d58eb --- imageio/tiffdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imageio/tiffdec.c b/imageio/tiffdec.c index 7894864c..d363d7ca 100644 --- a/imageio/tiffdec.c +++ b/imageio/tiffdec.c @@ -193,8 +193,8 @@ int ReadTIFF(const uint8_t* const data, size_t data_size, sizeof(*raster))) { goto End; } - if (!TIFFGetField(tif, TIFFTAG_EXTRASAMPLES, - &extra_samples, &extra_samples_ptr)) { + if (samples_per_px > 3 && !TIFFGetField(tif, TIFFTAG_EXTRASAMPLES, + &extra_samples, &extra_samples_ptr)) { fprintf(stderr, "Error! Cannot retrieve TIFF ExtraSamples info.\n"); goto End; }