From 06ed150673df73a1cdd16c4d980f4ec1438d341c Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Thu, 5 Feb 2009 19:21:45 +0000 Subject: [PATCH] remove assertions blown for corrupt files (#1995) --- ChangeLog | 7 ++++++- libtiff/tif_dirread.c | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8127807..28a74066 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ 2009-02-05 Frank Warmerdam + * 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 diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index 13bf0fe2..c3448264 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -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);