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
@ -997,28 +997,26 @@ _TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
** Do we have a custom value?
*/
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;
if( tv->info->field_tag != tag )
if (tv->info->field_tag != tag)
continue;
if( fip->field_passcount )
{
*va_arg(ap, unsigned short *) = (unsigned short) tv->count;
if (fip->field_passcount) {
if (fip->field_readcount == TIFF_VARIABLE2)
*va_arg(ap, uint32*) = (uint32)tv->count;
else /* Assume TIFF_VARIABLE */
*va_arg(ap, uint16*) = (uint16)tv->count;
*va_arg(ap, void **) = tv->value;
ret_val = 1;
break;
}
else if( fip->field_type == TIFF_ASCII )
{
} else if (fip->field_type == TIFF_ASCII) {
*va_arg(ap, void **) = tv->value;
ret_val = 1;
break;
}
else
{
} else {
TIFFError("_TIFFVGetField",
"%s: Pass by value is not implemented.",
tif->tif_name);
@ -1027,7 +1025,7 @@ _TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
}
}
}
return( ret_val );
return(ret_val);
}
/*