diff options
author | erouault <erouault> | 2016-11-04 09:19:13 +0000 |
---|---|---|
committer | erouault <erouault> | 2016-11-04 09:19:13 +0000 |
commit | ddaadde326d5e3baab05f778a90393dab9f0c34a (patch) | |
tree | e1e125816957d349759dcd0f1c82ef380a0ba8f7 | |
parent | 6879313598579758d779c545656d86cf5754f5b4 (diff) | |
download | libtiff-ddaadde326d5e3baab05f778a90393dab9f0c34a.tar.gz |
* libtiff/tif_predic.c: fix memory leaks in error code paths added in
previous commit (fix for MSVR 35105)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | libtiff/tif_predict.c | 10 |
2 files changed, 12 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2016-11-04 Even Rouault <even.rouault at spatialys.com> + + * libtiff/tif_predic.c: fix memory leaks in error code paths added in + previous commit (fix for MSVR 35105) + 2016-10-31 Even Rouault <even.rouault at spatialys.com> * libtiff/tif_predict.h, libtiff/tif_predict.c: diff --git a/libtiff/tif_predict.c b/libtiff/tif_predict.c index 1e16854d..0b185d2e 100644 --- a/libtiff/tif_predict.c +++ b/libtiff/tif_predict.c @@ -1,4 +1,4 @@ -/* $Id: tif_predict.c,v 1.39 2016-10-31 17:24:26 erouault Exp $ */ +/* $Id: tif_predict.c,v 1.40 2016-11-04 09:19:13 erouault Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -409,7 +409,7 @@ fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc) tmsize_t wc = cc / bps; tmsize_t count = cc; uint8 *cp = (uint8 *) cp0; - uint8 *tmp = (uint8 *)_TIFFmalloc(cc); + uint8 *tmp; if(cc%(bps*stride)!=0) { @@ -418,6 +418,7 @@ fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc) return 0; } + tmp = (uint8 *)_TIFFmalloc(cc); if (!tmp) return 0; @@ -640,7 +641,7 @@ fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc) tmsize_t wc = cc / bps; tmsize_t count; uint8 *cp = (uint8 *) cp0; - uint8 *tmp = (uint8 *)_TIFFmalloc(cc); + uint8 *tmp; if((cc%(bps*stride))!=0) { @@ -648,6 +649,8 @@ fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc) "%s", "(cc%(bps*stride))!=0"); return 0; } + + tmp = (uint8 *)_TIFFmalloc(cc); if (!tmp) return 0; @@ -722,6 +725,7 @@ PredictorEncodeTile(TIFF* tif, uint8* bp0, tmsize_t cc0, uint16 s) { TIFFErrorExt(tif->tif_clientdata, "PredictorEncodeTile", "%s", "(cc0%rowsize)!=0"); + _TIFFfree( working_copy ); return 0; } while (cc > 0) { |