diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c index 04738e83..32501ae7 100644 --- a/libtiff/tif_dirinfo.c +++ b/libtiff/tif_dirinfo.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirinfo.c,v 1.84 2007-06-28 12:43:07 joris Exp $ */ +/* $Id: tif_dirinfo.c,v 1.85 2007-06-29 19:20:57 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -476,6 +476,12 @@ _TIFFFindFieldInfo(TIFF* tif, uint32 tag, TIFFDataType dt) if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag && (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type)) return tif->tif_foundfield; + + /* If we are invoked with no field information, then just return. */ + if ( !tif->tif_fieldinfo ) { + return NULL; + } + /* NB: use sorted search (e.g. binary search) */ key.field_tag = tag;