Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

* libtiff/tif_predic.c: fix memory leaks in error code paths added in

previous commit (fix for MSVR 35105)
  • Loading branch information...
erouault
erouault committed Nov 4, 2016
1 parent 3ca657a commit 6a984bf7905c6621281588431f384e79d11a2e33
Showing with 11 additions and 2 deletions.
  1. +5 −0 ChangeLog
  2. +6 −2 libtiff/tif_predict.c
@@ -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:
@@ -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,14 +641,16 @@ 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)
{
TIFFErrorExt(tif->tif_clientdata, "fpDiff",
"%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) {

0 comments on commit 6a984bf

Please sign in to comment.
You can’t perform that action at this time.