summaryrefslogtreecommitdiff
path: root/libtiff/tif_ojpeg.c
diff options
context:
space:
mode:
authorBob Friesenhahn <bfriesen@simple.dallas.tx.us>2015-05-31 00:38:46 +0000
committerBob Friesenhahn <bfriesen@simple.dallas.tx.us>2015-05-31 00:38:46 +0000
commit2223910e235cfc43733c094671a1e8c63f6f3f07 (patch)
tree82f868cf7395acd556e9969951d3efed20adbc37 /libtiff/tif_ojpeg.c
parent86f9adb7fd7623c3708c3754c4cdc9a593b7f079 (diff)
downloadlibtiff-git-2223910e235cfc43733c094671a1e8c63f6f3f07.tar.gz
* libtiff/tif_dirwrite.c (_TIFFRewriteField): Fix Coverity 1024310
"Resource leak". * libtiff/tif_ojpeg.c (OJPEGReadHeaderInfoSecStreamDht): Fix Coverity 601720 "Resource leak".
Diffstat (limited to 'libtiff/tif_ojpeg.c')
-rw-r--r--libtiff/tif_ojpeg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c
index badd886f..23d40622 100644
--- a/libtiff/tif_ojpeg.c
+++ b/libtiff/tif_ojpeg.c
@@ -1,4 +1,4 @@
-/* $Id: tif_ojpeg.c,v 1.59 2015-05-30 23:49:28 bfriesen Exp $ */
+/* $Id: tif_ojpeg.c,v 1.60 2015-05-31 00:38:46 bfriesen Exp $ */
/* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0
specification is now totally obsolete and deprecated for new applications and
@@ -1497,14 +1497,17 @@ OJPEGReadHeaderInfoSecStreamDht(TIFF* tif)
nb[sizeof(uint32)+1]=JPEG_MARKER_DHT;
nb[sizeof(uint32)+2]=(m>>8);
nb[sizeof(uint32)+3]=(m&255);
- if (OJPEGReadBlock(sp,m-2,&nb[sizeof(uint32)+4])==0)
+ if (OJPEGReadBlock(sp,m-2,&nb[sizeof(uint32)+4])==0) {
+ _TIFFfree(nb);
return(0);
+ }
o=nb[sizeof(uint32)+4];
if ((o&240)==0)
{
if (3<o)
{
TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DHT marker in JPEG data");
+ _TIFFfree(nb);
return(0);
}
if (sp->dctable[o]!=0)
@@ -1516,12 +1519,14 @@ OJPEGReadHeaderInfoSecStreamDht(TIFF* tif)
if ((o&240)!=16)
{
TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DHT marker in JPEG data");
+ _TIFFfree(nb);
return(0);
}
o&=15;
if (3<o)
{
TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DHT marker in JPEG data");
+ _TIFFfree(nb);
return(0);
}
if (sp->actable[o]!=0)