From 1cf8becfc29c6b0a935191a55cefd3b4e5e69ce7 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Tue, 6 Jul 2010 14:16:05 +0000 Subject: [PATCH] Don't use assertions in _TIFFFieldWithTag() and _TIFFFieldWithName() if the tag is not found in the tag table. This should be normal situation and returned NULL value should be properly handled by the caller. --- ChangeLog | 7 +++++++ libtiff/tif_dirinfo.c | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7ad1cbb..1afd67ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-07-06 Andrey Kiselev + + * libtiff/tif_dirinfo.c: Don't use assertions in _TIFFFieldWithTag() + and _TIFFFieldWithName() if the tag is not found in the tag table. + This should be normal situation and returned NULL value should be + properly handled by the caller. + 2010-07-02 Andrey Kiselev * libtiff/tif_getimage.c: Avoid wrong math du to the signed/unsigned diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c index af35158c..2b1f82b5 100644 --- a/libtiff/tif_dirinfo.c +++ b/libtiff/tif_dirinfo.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirinfo.c,v 1.110 2010-06-13 19:37:23 fwarmerdam Exp $ */ +/* $Id: tif_dirinfo.c,v 1.111 2010-07-06 14:16:05 dron Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -538,8 +538,6 @@ TIFFFieldWithTag(TIFF* tif, uint32 tag) TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithTag", "Internal error, unknown tag 0x%x", (unsigned int) tag); - assert(fip != NULL); - /*NOTREACHED*/ } return (fip); } @@ -552,8 +550,6 @@ TIFFFieldWithName(TIFF* tif, const char *field_name) if (!fip) { TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithName", "Internal error, unknown tag %s", field_name); - assert(fip != NULL); - /*NOTREACHED*/ } return (fip); }