From bb17b1866a93e115e9af1181baaeaa2a8cffad5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= Date: Sun, 19 Nov 2017 16:24:40 +0100 Subject: Update bundled libtiff to version 4.0.9 [ChangeLog][Third-Party Code] Bundled libtiff was updated to version 4.0.9 Change-Id: I64a56d9b01cc1bb102a3368269ae9915fac5a051 Reviewed-by: Eirik Aavitsland --- src/3rdparty/libtiff/ChangeLog | 50 ++++++++++++++++++++++++++++- src/3rdparty/libtiff/RELEASE-DATE | 2 +- src/3rdparty/libtiff/TODO | 2 +- src/3rdparty/libtiff/VERSION | 2 +- src/3rdparty/libtiff/libtiff/SConstruct | 2 +- src/3rdparty/libtiff/libtiff/tif_aux.c | 4 +-- src/3rdparty/libtiff/libtiff/tif_config.h | 2 +- src/3rdparty/libtiff/libtiff/tif_getimage.c | 14 +++++--- src/3rdparty/libtiff/libtiff/tif_jpeg.c | 24 ++++++++++---- src/3rdparty/libtiff/libtiff/tif_read.c | 8 ++--- src/3rdparty/libtiff/libtiff/tif_win32.c | 2 ++ src/3rdparty/libtiff/libtiff/tiffiop.h | 6 +--- src/3rdparty/libtiff/libtiff/tiffvers.h | 4 +-- src/3rdparty/libtiff/qt_attribution.json | 2 +- 14 files changed, 93 insertions(+), 31 deletions(-) (limited to 'src/3rdparty/libtiff') diff --git a/src/3rdparty/libtiff/ChangeLog b/src/3rdparty/libtiff/ChangeLog index e15feec..ea8622b 100644 --- a/src/3rdparty/libtiff/ChangeLog +++ b/src/3rdparty/libtiff/ChangeLog @@ -1,3 +1,51 @@ +2017-11-18 Bob Friesenhahn + + * configure.ac: libtiff 4.0.9 released. + + * html/v4.0.9.html: Add HTML file to document changes in libtiff + v4.0.9. + +2017-11-17 Even Rouault + + * libtiff/tif_aux.c, tif_getimage.c, tif_read.c: typo fixes in + comments. + +2017-11-02 Bob Friesenhahn + + * test/Makefile.am: Add some tests for tiff2bw. + +2017-11-01 Bob Friesenhahn + + * tools/tiff2bw.c (main): Free memory allocated in the tiff2bw + program. This is in response to the report associated with + CVE-2017-16232 but does not solve the extremely high memory usage + with the associated POC file. + +2017-10-29 Bob Friesenhahn + + * tools/tiff2pdf.c (t2p_sample_realize_palette): Fix possible + arithmetic overflow in bounds checking code and eliminate + comparison between signed and unsigned type. + + * tools/fax2tiff.c (_FAX_Client_Data): Pass FAX_Client_Data as the + client data. This client data is not used at all at the moment, + but it makes the most sense. Issue that the value of + client_data.fd was passed where a pointer is expected was reported + via email by Gerald Schade on Sun, 29 Oct 2017. + +2017-10-23 Even Rouault + + * libtiff/tif_getimage.c: avoid floating point division by zero in + initCIELabConversion() + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3733 + Credit to OSS Fuzz + +2017-10-17 Even Rouault + + * libtiff/tif_jpeg.c: add compatibility with libjpeg-turbo 1.5.2 that + honours max_memory_to_use > 0. + Cf https://github.com/libjpeg-turbo/libjpeg-turbo/issues/162 + 2017-10-10 Even Rouault * nmake.opt: support a DEBUG=1 option, so as to adjust OPTFLAGS and use @@ -310,7 +358,7 @@ one to opt in to having a branch built on Windows with Cygwin, MinGW and MSVC automatically when a branch is pushed to GitHub, GitLab, BitBucket or any other supported git hosting service. - + * CMakeLists.txt, test/CMakeLists.txt, test/TiffTestCommon.cmake: apply patch 0001-cmake-Improve-Cygwin-and-MingGW-test-support.patch from Roger Leigh (sent to mailing list on 2017-06-08) diff --git a/src/3rdparty/libtiff/RELEASE-DATE b/src/3rdparty/libtiff/RELEASE-DATE index 301f356..f5a5ad7 100644 --- a/src/3rdparty/libtiff/RELEASE-DATE +++ b/src/3rdparty/libtiff/RELEASE-DATE @@ -1 +1 @@ -20170521 +20171118 diff --git a/src/3rdparty/libtiff/TODO b/src/3rdparty/libtiff/TODO index 121d93d..2ff8627 100644 --- a/src/3rdparty/libtiff/TODO +++ b/src/3rdparty/libtiff/TODO @@ -1,4 +1,4 @@ -# $Header: /cvs/maptools/cvsroot/libtiff/TODO,v 1.6 2002-10-10 05:28:43 warmerda Exp $ +# $Header: /cvs/libtiff/TODO,v 1.6 2002/10/10 05:28:43 warmerda Exp $ o gif2tiff segaulting on selected images o tiffcmp read data by strip/tile instead of scanline diff --git a/src/3rdparty/libtiff/VERSION b/src/3rdparty/libtiff/VERSION index a2cec7a..7919852 100644 --- a/src/3rdparty/libtiff/VERSION +++ b/src/3rdparty/libtiff/VERSION @@ -1 +1 @@ -4.0.8 +4.0.9 diff --git a/src/3rdparty/libtiff/libtiff/SConstruct b/src/3rdparty/libtiff/libtiff/SConstruct index dc00c8c..cb6a7cc 100644 --- a/src/3rdparty/libtiff/libtiff/SConstruct +++ b/src/3rdparty/libtiff/libtiff/SConstruct @@ -1,4 +1,4 @@ -# $Id: SConstruct,v 1.4 2007-02-24 15:03:50 dron Exp $ +# $Id: SConstruct,v 1.4 2007/02/24 15:03:50 dron Exp $ # Tag Image File Format (TIFF) Software # diff --git a/src/3rdparty/libtiff/libtiff/tif_aux.c b/src/3rdparty/libtiff/libtiff/tif_aux.c index 7f6721b..10b8d00 100644 --- a/src/3rdparty/libtiff/libtiff/tif_aux.c +++ b/src/3rdparty/libtiff/libtiff/tif_aux.c @@ -1,4 +1,4 @@ -/* $Id: tif_aux.c,v 1.30 2017-09-07 14:02:52 erouault Exp $ */ +/* $Id: tif_aux.c,v 1.31 2017-11-17 20:21:00 erouault Exp $ */ /* * Copyright (c) 1991-1997 Sam Leffler @@ -361,7 +361,7 @@ _TIFFUInt64ToDouble(uint64 ui64) int _TIFFSeekOK(TIFF* tif, toff_t off) { - /* Huge offsets, expecially -1 / UINT64_MAX, can cause issues */ + /* Huge offsets, especially -1 / UINT64_MAX, can cause issues */ /* See http://bugzilla.maptools.org/show_bug.cgi?id=2726 */ return off <= (~(uint64)0)/2 && TIFFSeekFile(tif,off,SEEK_SET)==off; } diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h b/src/3rdparty/libtiff/libtiff/tif_config.h index 2924a34..7306e52 100644 --- a/src/3rdparty/libtiff/libtiff/tif_config.h +++ b/src/3rdparty/libtiff/libtiff/tif_config.h @@ -266,7 +266,7 @@ /* #undef PACKAGE_URL */ /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.0.8" +#define PACKAGE_VERSION "4.0.9" /* Support Macintosh PackBits algorithm */ /* #undef PACKBITS_SUPPORT */ diff --git a/src/3rdparty/libtiff/libtiff/tif_getimage.c b/src/3rdparty/libtiff/libtiff/tif_getimage.c index c51c889..fc554cc 100644 --- a/src/3rdparty/libtiff/libtiff/tif_getimage.c +++ b/src/3rdparty/libtiff/libtiff/tif_getimage.c @@ -1,4 +1,4 @@ -/* $Id: tif_getimage.c,v 1.112 2017-07-24 10:34:14 erouault Exp $ */ +/* $Id: tif_getimage.c,v 1.114 2017-11-17 20:21:00 erouault Exp $ */ /* * Copyright (c) 1991-1997 Sam Leffler @@ -138,7 +138,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024]) /* * TODO: if at all meaningful and useful, make more complete * support check here, or better still, refactor to let supporting - * code decide whether there is support and what meaningfull + * code decide whether there is support and what meaningful * error to return */ break; @@ -416,7 +416,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024]) /* * TODO: if at all meaningful and useful, make more complete * support check here, or better still, refactor to let supporting - * code decide whether there is support and what meaningfull + * code decide whether there is support and what meaningful * error to return */ break; @@ -2332,6 +2332,13 @@ initCIELabConversion(TIFFRGBAImage* img) float *whitePoint; float refWhite[3]; + TIFFGetFieldDefaulted(img->tif, TIFFTAG_WHITEPOINT, &whitePoint); + if (whitePoint[1] == 0.0f ) { + TIFFErrorExt(img->tif->tif_clientdata, module, + "Invalid value for WhitePoint tag."); + return NULL; + } + if (!img->cielab) { img->cielab = (TIFFCIELabToRGB *) _TIFFmalloc(sizeof(TIFFCIELabToRGB)); @@ -2342,7 +2349,6 @@ initCIELabConversion(TIFFRGBAImage* img) } } - TIFFGetFieldDefaulted(img->tif, TIFFTAG_WHITEPOINT, &whitePoint); refWhite[1] = 100.0F; refWhite[0] = whitePoint[0] / whitePoint[1] * refWhite[1]; refWhite[2] = (1.0F - whitePoint[0] - whitePoint[1]) diff --git a/src/3rdparty/libtiff/libtiff/tif_jpeg.c b/src/3rdparty/libtiff/libtiff/tif_jpeg.c index eed1357..0fbdb35 100644 --- a/src/3rdparty/libtiff/libtiff/tif_jpeg.c +++ b/src/3rdparty/libtiff/libtiff/tif_jpeg.c @@ -1,4 +1,4 @@ -/* $Id: tif_jpeg.c,v 1.133 2017-08-29 08:08:10 erouault Exp $ */ +/* $Id: tif_jpeg.c,v 1.134 2017-10-17 19:04:47 erouault Exp $ */ /* * Copyright (c) 1994-1997 Sam Leffler @@ -2456,12 +2456,22 @@ static int JPEGInitializeLibJPEG( TIFF * tif, int decompress ) #ifndef TIFF_JPEG_MAX_MEMORY_TO_USE #define TIFF_JPEG_MAX_MEMORY_TO_USE (10 * 1024 * 1024) #endif - /* Increase the max memory usable. This helps when creating files */ - /* with "big" tile, without using libjpeg temporary files. */ - /* For example a 512x512 tile with 3 bands */ - /* requires 1.5 MB which is above libjpeg 1MB default */ - if( sp->cinfo.c.mem->max_memory_to_use < TIFF_JPEG_MAX_MEMORY_TO_USE ) - sp->cinfo.c.mem->max_memory_to_use = TIFF_JPEG_MAX_MEMORY_TO_USE; + /* libjpeg turbo 1.5.2 honours max_memory_to_use, but has no backing */ + /* store implementation, so better not set max_memory_to_use ourselves. */ + /* See https://github.com/libjpeg-turbo/libjpeg-turbo/issues/162 */ + if( sp->cinfo.c.mem->max_memory_to_use > 0 ) + { + /* This is to address bug related in ticket GDAL #1795. */ + if (getenv("JPEGMEM") == NULL) + { + /* Increase the max memory usable. This helps when creating files */ + /* with "big" tile, without using libjpeg temporary files. */ + /* For example a 512x512 tile with 3 bands */ + /* requires 1.5 MB which is above libjpeg 1MB default */ + if( sp->cinfo.c.mem->max_memory_to_use < TIFF_JPEG_MAX_MEMORY_TO_USE ) + sp->cinfo.c.mem->max_memory_to_use = TIFF_JPEG_MAX_MEMORY_TO_USE; + } + } } sp->cinfo_initialized = TRUE; diff --git a/src/3rdparty/libtiff/libtiff/tif_read.c b/src/3rdparty/libtiff/libtiff/tif_read.c index d5ce837..2ba985a 100644 --- a/src/3rdparty/libtiff/libtiff/tif_read.c +++ b/src/3rdparty/libtiff/libtiff/tif_read.c @@ -1,4 +1,4 @@ -/* $Id: tif_read.c,v 1.65 2017-07-15 12:33:25 erouault Exp $ */ +/* $Id: tif_read.c,v 1.66 2017-11-17 20:21:00 erouault Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -544,7 +544,7 @@ TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size) /* Variant of TIFFReadEncodedStrip() that does * * if *buf == NULL, *buf = _TIFFmalloc(bufsizetoalloc) only after TIFFFillStrip() has - * suceeded. This avoid excessive memory allocation in case of truncated + * succeeded. This avoid excessive memory allocation in case of truncated * file. * * calls regular TIFFReadEncodedStrip() if *buf != NULL */ @@ -1019,7 +1019,7 @@ TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size) /* Variant of TIFFReadTile() that does * * if *buf == NULL, *buf = _TIFFmalloc(bufsizetoalloc) only after TIFFFillTile() has - * suceeded. This avoid excessive memory allocation in case of truncated + * succeeded. This avoid excessive memory allocation in case of truncated * file. * * calls regular TIFFReadEncodedTile() if *buf != NULL */ @@ -1038,7 +1038,7 @@ _TIFFReadTileAndAllocBuffer(TIFF* tif, /* Variant of TIFFReadEncodedTile() that does * * if *buf == NULL, *buf = _TIFFmalloc(bufsizetoalloc) only after TIFFFillTile() has - * suceeded. This avoid excessive memory allocation in case of truncated + * succeeded. This avoid excessive memory allocation in case of truncated * file. * * calls regular TIFFReadEncodedTile() if *buf != NULL */ diff --git a/src/3rdparty/libtiff/libtiff/tif_win32.c b/src/3rdparty/libtiff/libtiff/tif_win32.c index ea40163..090baed 100644 --- a/src/3rdparty/libtiff/libtiff/tif_win32.c +++ b/src/3rdparty/libtiff/libtiff/tif_win32.c @@ -398,6 +398,7 @@ _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c) return (memcmp(p1, p2, (size_t) c)); } +#ifndef _WIN32_WCE #if (_MSC_VER < 1500) # define vsnprintf _vsnprintf @@ -463,6 +464,7 @@ Win32ErrorHandler(const char* module, const char* fmt, va_list ap) } TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; +#endif /* ndef _WIN32_WCE */ /* vim: set ts=8 sts=8 sw=8 noet: */ /* diff --git a/src/3rdparty/libtiff/libtiff/tiffiop.h b/src/3rdparty/libtiff/libtiff/tiffiop.h index 4da486b..daa291c 100644 --- a/src/3rdparty/libtiff/libtiff/tiffiop.h +++ b/src/3rdparty/libtiff/libtiff/tiffiop.h @@ -37,11 +37,7 @@ #endif #ifdef HAVE_SYS_TYPES_H -# ifdef Q_OS_WINCE -# include -# else -# include -# endif +# include #endif #ifdef HAVE_STRING_H diff --git a/src/3rdparty/libtiff/libtiff/tiffvers.h b/src/3rdparty/libtiff/libtiff/tiffvers.h index 890e433..7c41574 100644 --- a/src/3rdparty/libtiff/libtiff/tiffvers.h +++ b/src/3rdparty/libtiff/libtiff/tiffvers.h @@ -1,4 +1,4 @@ -#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.8\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." +#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.9\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." /* * This define can be used in code that requires * compilation-related definitions specific to a @@ -6,4 +6,4 @@ * version checking should be done based on the * string returned by TIFFGetVersion. */ -#define TIFFLIB_VERSION 20170521 +#define TIFFLIB_VERSION 20171118 diff --git a/src/3rdparty/libtiff/qt_attribution.json b/src/3rdparty/libtiff/qt_attribution.json index 52b4413..c247ea2 100644 --- a/src/3rdparty/libtiff/qt_attribution.json +++ b/src/3rdparty/libtiff/qt_attribution.json @@ -6,7 +6,7 @@ "Description": "", "Homepage": "http://www.simplesystems.org/libtiff/", - "Version": "4.0.8", + "Version": "4.0.9", "License": "libtiff License", "LicenseId": "libtiff", "LicenseFile": "COPYRIGHT", -- cgit v1.2.1