* 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
This commit is contained in:
parent
09a7433335
commit
19a159d7c4
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user