summaryrefslogtreecommitdiff
path: root/libtiff/tif_pixarlog.c
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-05-10 15:21:16 +0000
committerEven Rouault <even.rouault@spatialys.com>2017-05-10 15:21:16 +0000
commit328189565baea5e1d4df45311cdb8c8ae0d45915 (patch)
tree0d251861c8e444b76b099f543ff4f6cdbc75d389 /libtiff/tif_pixarlog.c
parent8fb826526005f8275687a932b52dce5c65203deb (diff)
downloadlibtiff-git-328189565baea5e1d4df45311cdb8c8ae0d45915.tar.gz
* libtiff/tif_zip.c, tif_pixarlog.c, tif_predict.c: fix memory
leak when the underlying codec (ZIP, PixarLog) succeeds its setupdecode() method, but PredictorSetup fails. Credit to OSS-Fuzz (locally run, on GDAL)
Diffstat (limited to 'libtiff/tif_pixarlog.c')
-rw-r--r--libtiff/tif_pixarlog.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c
index 972ee75e..ae84fff5 100644
--- a/libtiff/tif_pixarlog.c
+++ b/libtiff/tif_pixarlog.c
@@ -1,4 +1,4 @@
-/* $Id: tif_pixarlog.c,v 1.50 2017-02-18 20:30:26 erouault Exp $ */
+/* $Id: tif_pixarlog.c,v 1.51 2017-05-10 15:21:16 erouault Exp $ */
/*
* Copyright (c) 1996-1997 Sam Leffler
@@ -678,6 +678,12 @@ PixarLogSetupDecode(TIFF* tif)
assert(sp != NULL);
+ /* This function can possibly be called several times by */
+ /* PredictorSetupDecode() if this function succeeds but */
+ /* PredictorSetup() fails */
+ if( (sp->state & PLSTATE_INIT) != 0 )
+ return 1;
+
/* Make sure no byte swapping happens on the data
* after decompression. */
tif->tif_postdecode = _TIFFNoPostDecode;