* libtiff/tif_dirread.c: tolerate some cases where

FIELD_COLORMAP is missing
        http://bugzilla.maptools.org/show_bug.cgi?id=2189
This commit is contained in:
Lee Howard 2010-12-15 01:05:02 +00:00
parent 69bb27992d
commit bf44739aea
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2010-12-14 Lee Howard <faxguy@howardsilvan.com>
* libtiff/tif_dirread.c: tolerate some cases where
FIELD_COLORMAP is missing
http://bugzilla.maptools.org/show_bug.cgi?id=2189
2010-12-14 Lee Howard <faxguy@howardsilvan.com>
* libtiff/tif_read.c: change read_ahead to tmsize_t

View File

@ -1,4 +1,4 @@
/* $Id: tif_dirread.c,v 1.164 2010-12-14 03:03:24 faxguy Exp $ */
/* $Id: tif_dirread.c,v 1.165 2010-12-15 01:05:02 faxguy Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -3845,9 +3845,15 @@ TIFFReadDirectory(TIFF* tif)
*/
if (tif->tif_dir.td_photometric == PHOTOMETRIC_PALETTE &&
!TIFFFieldSet(tif, FIELD_COLORMAP)) {
if ( tif->tif_dir.td_bitspersample>=8 && tif->tif_dir.td_samplesperpixel==3)
tif->tif_dir.td_photometric = PHOTOMETRIC_RGB;
else if (tif->tif_dir.td_bitspersample>=8)
tif->tif_dir.td_photometric = PHOTOMETRIC_MINISBLACK;
else {
MissingRequired(tif, "Colormap");
goto bad;
}
}
/*
* OJPEG hack:
* We do no further messing with strip/tile offsets/bytecounts in OJPEG