* libtiff/tif_dir.c: in TIFFDefaultDirectory(), reset any already existing

extented tags installed by user code through the extender mechaninm before
calling the extender callback (GDAL #5054)
This commit is contained in:
Even Rouault 2014-12-27 15:20:42 +00:00
parent fdfa1a026f
commit 5b06ac3f28
2 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2014-12-27 Even Rouault <even.rouault@spatialys.com>
* libtiff/tif_dir.c: in TIFFDefaultDirectory(), reset any already existing
extented tags installed by user code through the extender mechaninm before
calling the extender callback (GDAL #5054)
2014-12-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* tools/tiffcrop.c: Fix warnings about variables set but not used.

View File

@ -1,4 +1,4 @@
/* $Id: tif_dir.c,v 1.118 2014-12-21 15:15:31 erouault Exp $ */
/* $Id: tif_dir.c,v 1.119 2014-12-27 15:20:42 erouault Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -1322,8 +1322,20 @@ TIFFDefaultDirectory(TIFF* tif)
tif->tif_tagmethods.printdir = NULL;
/*
* Give client code a chance to install their own
* tag extensions & methods, prior to compression overloads.
* tag extensions & methods, prior to compression overloads,
* but do some prior cleanup first. (http://trac.osgeo.org/gdal/ticket/5054)
*/
if (tif->tif_nfieldscompat > 0) {
uint32 i;
for (i = 0; i < tif->tif_nfieldscompat; i++) {
if (tif->tif_fieldscompat[i].allocated_size)
_TIFFfree(tif->tif_fieldscompat[i].fields);
}
_TIFFfree(tif->tif_fieldscompat);
tif->tif_nfieldscompat = 0;
tif->tif_fieldscompat = NULL;
}
if (_TIFFextender)
(*_TIFFextender)(tif);
(void) TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);