remove assertions blown for corrupt files (#1995)

This commit is contained in:
Frank Warmerdam 2009-02-05 19:21:45 +00:00
parent 0068fcf5ad
commit 06ed150673
2 changed files with 11 additions and 6 deletions

View File

@ -1,7 +1,12 @@
2009-02-05 Frank Warmerdam <warmerdam@pobox.com>
* libtiff/tif_dirread.c: Remove some assertions that blow due to
corrupt files rather than in response to library internal
inconsistencies.
http://bugzilla.maptools.org/show_bug.cgi?id=1995
* libtiff/tif_dirread.c: Fixed testing for failed result from
TIFFReadDirectoryFindFieldInfo().
TIFFReadDirectoryFindFieldInfo().
http://bugzilla.maptools.org/show_bug.cgi?id=1992
2009-01-23 Frank Warmerdam <warmerdam@pobox.com>

View File

@ -1,4 +1,4 @@
/* $Id: tif_dirread.c,v 1.149 2009-02-05 16:07:59 fwarmerdam Exp $ */
/* $Id: tif_dirread.c,v 1.150 2009-02-05 19:21:45 fwarmerdam Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -4748,7 +4748,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
if (dp->tdir_count!=(uint64)fip->field_readcount)
assert(0);
/* corrupt file */;
else
{
err=TIFFReadDirEntryByteArray(tif,dp,&data);
@ -4770,7 +4770,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
if (dp->tdir_count!=(uint64)fip->field_readcount)
assert(0);
/* corrupt file */;
else
{
err=TIFFReadDirEntryShortArray(tif,dp,&data);
@ -4792,7 +4792,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
if (dp->tdir_count!=(uint64)fip->field_readcount)
assert(0);
/* corrupt file */;
else
{
err=TIFFReadDirEntryLongArray(tif,dp,&data);
@ -4814,7 +4814,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
if (dp->tdir_count!=(uint64)fip->field_readcount)
assert(0);
/* corrupt file */;
else
{
err=TIFFReadDirEntryFloatArray(tif,dp,&data);