diff options
author | erouault <erouault> | 2017-02-18 20:30:26 +0000 |
---|---|---|
committer | erouault <erouault> | 2017-02-18 20:30:26 +0000 |
commit | 340153b9b9234317e7693a23ad67b6b395af2a59 (patch) | |
tree | 326ee361e8c9c37b118eac5d4950ee6ee0731062 | |
parent | fc6714e0c6bb22bbbd517a930106000572833e45 (diff) | |
download | libtiff-340153b9b9234317e7693a23ad67b6b395af2a59.tar.gz |
* libtiff/tif_pixarlog.c: fix memory leak in error code path of
PixarLogSetupDecode(). Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2665
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libtiff/tif_pixarlog.c | 8 |
2 files changed, 13 insertions, 1 deletions
@@ -1,5 +1,11 @@ 2017-02-18 Even Rouault <even.rouault at spatialys.com> + * libtiff/tif_pixarlog.c: fix memory leak in error code path of + PixarLogSetupDecode(). Patch by Nicolás Peña. + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2665 + +2017-02-18 Even Rouault <even.rouault at spatialys.com> + * libtiff/tif_lzw.c: in LZWPostEncode(), increase, if necessary, the code bit-width after flushing the remaining code and before emitting the EOI code. diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c index 9836dce6..972ee75e 100644 --- a/libtiff/tif_pixarlog.c +++ b/libtiff/tif_pixarlog.c @@ -1,4 +1,4 @@ -/* $Id: tif_pixarlog.c,v 1.49 2016-12-02 23:05:51 erouault Exp $ */ +/* $Id: tif_pixarlog.c,v 1.50 2017-02-18 20:30:26 erouault Exp $ */ /* * Copyright (c) 1996-1997 Sam Leffler @@ -699,6 +699,9 @@ PixarLogSetupDecode(TIFF* tif) if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) sp->user_datafmt = PixarLogGuessDataFmt(td); if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) { + _TIFFfree(sp->tbuf); + sp->tbuf = NULL; + sp->tbuf_size = 0; TIFFErrorExt(tif->tif_clientdata, module, "PixarLog compression can't handle bits depth/data format combination (depth: %d)", td->td_bitspersample); @@ -706,6 +709,9 @@ PixarLogSetupDecode(TIFF* tif) } if (inflateInit(&sp->stream) != Z_OK) { + _TIFFfree(sp->tbuf); + sp->tbuf = NULL; + sp->tbuf_size = 0; TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg ? sp->stream.msg : "(null)"); return (0); } else { |