summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfaxguy <faxguy>2010-12-11 22:32:32 +0000
committerfaxguy <faxguy>2010-12-11 22:32:32 +0000
commitab04fd7544381f861e235ace417e61610cf8e783 (patch)
treed6353337fb2cbfc8b2b7920daa8b82cb167fd26b
parent9a5397943fbe07cd57480a86e6b00a9b113fd72e (diff)
downloadlibtiff-ab04fd7544381f861e235ace417e61610cf8e783.tar.gz
* libtiff/tif_dirread.c: modify warnings
http://bugzilla.maptools.org/show_bug.cgi?id=2016
-rw-r--r--ChangeLog5
-rw-r--r--libtiff/tif_dirread.c20
2 files changed, 19 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 38087716..96cdabab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2010-12-11 Lee Howard <faxguy@howardsilvan.com>
+ * libtiff/tif_dirread.c: modify warnings
+ http://bugzilla.maptools.org/show_bug.cgi?id=2016
+
+2010-12-11 Lee Howard <faxguy@howardsilvan.com>
+
* libtiff/tif_ojpeg.c: fix buffer overflow on problem data
http://bugzilla.maptools.org/show_bug.cgi?id=1999
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index 8b6ecf96..5f974da1 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -1,4 +1,4 @@
-/* $Id: tif_dirread.c,v 1.92.2.11 2010-12-08 17:44:35 faxguy Exp $ */
+/* $Id: tif_dirread.c,v 1.92.2.12 2010-12-11 22:32:32 faxguy Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -606,8 +606,7 @@ TIFFReadDirectory(TIFF* tif)
}
if (!TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL))
{
- if ((td->td_photometric==PHOTOMETRIC_RGB)
- || (td->td_photometric==PHOTOMETRIC_YCBCR))
+ if (td->td_photometric==PHOTOMETRIC_RGB)
{
TIFFWarningExt(tif->tif_clientdata,
"TIFFReadDirectory",
@@ -616,13 +615,22 @@ TIFFReadDirectory(TIFF* tif)
if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,3))
goto bad;
}
- else if ((td->td_photometric==PHOTOMETRIC_MINISWHITE)
- || (td->td_photometric==PHOTOMETRIC_MINISBLACK))
+ if (td->td_photometric==PHOTOMETRIC_YCBCR)
{
TIFFWarningExt(tif->tif_clientdata,
"TIFFReadDirectory",
"SamplesPerPixel tag is missing, "
- "assuming correct SamplesPerPixel value is 1");
+ "applying correct SamplesPerPixel value of 3");
+ if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,3))
+ goto bad;
+ }
+ else if ((td->td_photometric==PHOTOMETRIC_MINISWHITE)
+ || (td->td_photometric==PHOTOMETRIC_MINISBLACK))
+ {
+ /*
+ * SamplesPerPixel tag is missing, but is not required
+ * by spec. Assume correct SamplesPerPixel value of 1.
+ */
if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,1))
goto bad;
}