diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | libtiff/tif_dirwrite.c | 9 |
2 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2017-08-23 Even Rouault <even.rouault at spatialys.com> + + * libtiff/tif_dirwrite.c: replace assertion related to not finding the + SubIFD tag by runtime check. + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2727 + Reported by team OWL337 + 2017-07-24 Even Rouault <even.rouault at spatialys.com> * libtiff/tif_luv.c: further reduce memory requirements for temporary diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c index 449cec32..9553f860 100644 --- a/libtiff/tif_dirwrite.c +++ b/libtiff/tif_dirwrite.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirwrite.c,v 1.87 2017-06-30 17:31:45 erouault Exp $ */ +/* $Id: tif_dirwrite.c,v 1.88 2017-08-23 13:21:42 erouault Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -821,7 +821,12 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff) TIFFDirEntry* nb; for (na=0, nb=dir; ; na++, nb++) { - assert(na<ndir); + if( na == ndir ) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Cannot find SubIFD tag"); + goto bad; + } if (nb->tdir_tag==TIFFTAG_SUBIFD) break; } |