diff options
author | erouault <erouault> | 2017-01-12 17:43:25 +0000 |
---|---|---|
committer | erouault <erouault> | 2017-01-12 17:43:25 +0000 |
commit | 5cb7ef825122b31863b709802a554f650ce72817 (patch) | |
tree | a22357077c334dae8222afb2bfc8a879f935f57a | |
parent | 527a80a952ca90aacf710357db2e34252254a39b (diff) | |
download | libtiff-5cb7ef825122b31863b709802a554f650ce72817.tar.gz |
* libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable
when read fails.
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | libtiff/tif_ojpeg.c | 5 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2017-01-12 Even Rouault <even.rouault at spatialys.com> + + * libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable + when read fails. + Patch by Nicolás Peña. + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659 + 2017-01-11 Even Rouault <even.rouault at spatialys.com> * libtiff/tif_luv.c, tif_lzw.c, tif_packbits.c: return 0 in Encode diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c index 93839d8f..ac70d1b1 100644 --- a/libtiff/tif_ojpeg.c +++ b/libtiff/tif_ojpeg.c @@ -1,4 +1,4 @@ -/* $Id: tif_ojpeg.c,v 1.66 2016-12-03 11:15:18 erouault Exp $ */ +/* $Id: tif_ojpeg.c,v 1.67 2017-01-12 17:43:26 erouault 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 @@ -1918,7 +1918,10 @@ OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif) rb[sizeof(uint32)+5+n]=o[n]; p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q); if (p!=q) + { + _TIFFfree(rb); return(0); + } sp->actable[m]=rb; sp->sos_tda[m]=(sp->sos_tda[m]|m); } |