You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.6 KiB

  1. From 8283e4d1b7e53340684d12932880cbcbaf23a8c1 Mon Sep 17 00:00:00 2001
  2. From: erouault <erouault>
  3. Date: Thu, 12 Jan 2017 17:43:25 +0000
  4. Subject: [PATCH] =?UTF-8?q?*=20libtiff/tif=5Fojpeg.c:=20fix=20leak=20in=20?=
  5. =?UTF-8?q?OJPEGReadHeaderInfoSecTablesAcTable=20when=20read=20fails.=20Pa?=
  6. =?UTF-8?q?tch=20by=20Nicol=C3=A1s=20Pe=C3=B1a.=20Fixes=20http://bugzilla.?=
  7. =?UTF-8?q?maptools.org/show=5Fbug.cgi=3Fid=3D2659?=
  8. MIME-Version: 1.0
  9. Content-Type: text/plain; charset=UTF-8
  10. Content-Transfer-Encoding: 8bit
  11. ---
  12. ChangeLog | 7 +++++++
  13. libtiff/tif_ojpeg.c | 3 +++
  14. 2 files changed, 10 insertions(+)
  15. diff --git a/ChangeLog b/ChangeLog
  16. index 6e6f3b0..12e0370 100644
  17. --- a/ChangeLog
  18. +++ b/ChangeLog
  19. @@ -1,3 +1,10 @@
  20. +2017-01-12 Even Rouault <even.rouault at spatialys.com>
  21. +
  22. + * libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable
  23. + when read fails.
  24. + Patch by Nicolás Peña.
  25. + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
  26. +
  27. 2017-01-11 Even Rouault <even.rouault at spatialys.com>
  28. * libtiff/tiffiop.h, tif_unix.c, tif_win32.c, tif_vms.c: add _TIFFcalloc()
  29. diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c
  30. index f19e8fd..b92f0eb 100644
  31. --- a/libtiff/tif_ojpeg.c
  32. +++ b/libtiff/tif_ojpeg.c
  33. @@ -1918,7 +1918,10 @@ OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif)
  34. rb[sizeof(uint32)+5+n]=o[n];
  35. p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
  36. if (p!=q)
  37. + {
  38. + _TIFFfree(rb);
  39. return(0);
  40. + }
  41. sp->actable[m]=rb;
  42. sp->sos_tda[m]=(sp->sos_tda[m]|m);
  43. }