Properly handle tags, which have the uint32 counts. As per bug

http://bugzilla.remotesensing.org/show_bug.cgi?id=693
This commit is contained in:
Andrey Kiselev 2004-11-29 16:39:13 +00:00
parent d9845f725c
commit 9a94eb411e

View File

@ -1,4 +1,4 @@
/* $Id: tif_dir.c,v 1.41 2004-10-09 18:33:56 dron Exp $ */ /* $Id: tif_dir.c,v 1.42 2004-11-29 16:39:13 dron Exp $ */
/* /*
* Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1988-1997 Sam Leffler
@ -997,37 +997,35 @@ _TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
** Do we have a custom value? ** Do we have a custom value?
*/ */
ret_val = 0; ret_val = 0;
for( i = 0; i < td->td_customValueCount; i++ ) for (i = 0; i < td->td_customValueCount; i++)
{ {
TIFFTagValue *tv = td->td_customValues + i; TIFFTagValue *tv = td->td_customValues + i;
if( tv->info->field_tag != tag ) if (tv->info->field_tag != tag)
continue; continue;
if( fip->field_passcount ) if (fip->field_passcount) {
{ if (fip->field_readcount == TIFF_VARIABLE2)
*va_arg(ap, unsigned short *) = (unsigned short) tv->count; *va_arg(ap, uint32*) = (uint32)tv->count;
*va_arg(ap, void **) = tv->value; else /* Assume TIFF_VARIABLE */
ret_val = 1; *va_arg(ap, uint16*) = (uint16)tv->count;
break; *va_arg(ap, void **) = tv->value;
} ret_val = 1;
else if( fip->field_type == TIFF_ASCII ) break;
{ } else if (fip->field_type == TIFF_ASCII) {
*va_arg(ap, void **) = tv->value; *va_arg(ap, void **) = tv->value;
ret_val = 1; ret_val = 1;
break; break;
} } else {
else TIFFError("_TIFFVGetField",
{ "%s: Pass by value is not implemented.",
TIFFError("_TIFFVGetField", tif->tif_name);
"%s: Pass by value is not implemented.", break;
tif->tif_name);
break;
} }
} }
} }
} }
return( ret_val ); return(ret_val);
} }
/* /*