From 9184521f3f0474a902cdc6e3aeb134f7bef25dec Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Fri, 1 Jun 2012 00:55:09 +0000 Subject: [PATCH] make sure tif_rawdatasize is zeroed when tif_rawdata is freed/cleared --- ChangeLog | 2 ++ libtiff/tif_read.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c3f55963..70c71649 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2012-05-31 Frank Warmerdam + * libtiff/tif_read.c: Make sure tif_rawdatasize is cleared when tif_rawdata is freed. + * libtiff/tif_getimage.c: Add support for greyscale+alpha c/o Jérémie Laval. http://bugzilla.maptools.org/show_bug.cgi?id=2398 diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c index cabac383..3ba31e3f 100644 --- a/libtiff/tif_read.c +++ b/libtiff/tif_read.c @@ -1,4 +1,4 @@ -/* $Id: tif_read.c,v 1.39 2012-05-30 01:50:17 fwarmerdam Exp $ */ +/* $Id: tif_read.c,v 1.40 2012-06-01 00:55:09 fwarmerdam Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -529,6 +529,7 @@ TIFFFillStrip(TIFF* tif, uint32 strip) if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) { _TIFFfree(tif->tif_rawdata); tif->tif_rawdata = NULL; + tif->tif_rawdatasize = 0; } tif->tif_flags &= ~TIFF_MYBUFFER; /* @@ -831,6 +832,7 @@ TIFFFillTile(TIFF* tif, uint32 tile) if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) { _TIFFfree(tif->tif_rawdata); tif->tif_rawdata = NULL; + tif->tif_rawdatasize = 0; } tif->tif_flags &= ~TIFF_MYBUFFER; /* @@ -920,6 +922,7 @@ TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size) if (tif->tif_flags & TIFF_MYBUFFER) _TIFFfree(tif->tif_rawdata); tif->tif_rawdata = NULL; + tif->tif_rawdatasize = 0; } if (bp) { tif->tif_rawdatasize = size;