summaryrefslogtreecommitdiff
path: root/libtiff/tif_dirread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtiff/tif_dirread.c')
-rw-r--r--libtiff/tif_dirread.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index 431a7372..567db8c2 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -1,4 +1,4 @@
-/* $Header: /usr/local/cvs/internal/libtiff/libtiff/tif_dirread.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
+/* $Header: /cvsroot/osrs/libtiff/libtiff/tif_dirread.c,v 1.3 1999/09/08 19:07:02 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -210,11 +210,17 @@ TIFFReadDirectory(TIFF* tif)
*/
fix = 0;
for (dp = dir, n = dircount; n > 0; n--, dp++) {
- /*
- * Find the field information entry for this tag.
- */
+
+ /*
+ * Find the field information entry for this tag.
+ * Added check for tags to ignore ... [BFC]
+ */
+ if( TIFFReassignTagToIgnore(TIS_EXTRACT, dp->tdir_tag) )
+ dp->tdir_tag = IGNORE;
+
if (dp->tdir_tag == IGNORE)
- continue;
+ continue;
+
/*
* Silicon Beach (at least) writes unordered
* directory tags (violating the spec). Handle
@@ -1037,7 +1043,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
* NULL byte, so always append one just in case.
*/
cp = CheckMalloc(tif, dp->tdir_count+1, mesg);
- if (ok = (cp && TIFFFetchString(tif, dp, cp)))
+ if( (ok = (cp && TIFFFetchString(tif, dp, cp))) != 0 )
cp[dp->tdir_count] = '\0'; /* XXX */
break;
}
@@ -1110,7 +1116,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
case TIFF_ASCII:
case TIFF_UNDEFINED: /* bit of a cheat... */
{ char c[2];
- if (ok = (TIFFFetchString(tif, dp, c) != 0)) {
+ if( (ok = (TIFFFetchString(tif, dp, c) != 0)) != 0 ){
c[1] = '\0'; /* XXX paranoid */
ok = TIFFSetField(tif, dp->tdir_tag, c);
}
@@ -1224,7 +1230,7 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp)
dir->tdir_count* sizeof (uint16), "to fetch strip tag");
if (dp == NULL)
return (0);
- if (status = TIFFFetchShortArray(tif, dir, dp)) {
+ if( (status = TIFFFetchShortArray(tif, dir, dp)) != 0 ) {
register uint16* wp = dp;
while (nstrips-- > 0)
*lp++ = *wp++;
@@ -1277,10 +1283,10 @@ TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir)
* Handle LONG's for backward compatibility.
*/
cp = CheckMalloc(tif, dir->tdir_count * sizeof (uint32), mesg);
- if (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) {
+ if( (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) != 0) {
float* fp = (float*)
CheckMalloc(tif, dir->tdir_count * sizeof (float), mesg);
- if (ok = (fp != NULL)) {
+ if( (ok = (fp != NULL)) != 0 ) {
uint32 i;
for (i = 0; i < dir->tdir_count; i++)
fp[i] = (float)((uint32*) cp)[i];