summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2018-11-16 15:01:08 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2018-11-19 12:34:27 +0000
commit43403038cf75086409bf7ee485ae855fd4c1c1e1 (patch)
treeea10eae91b39fd075491dfa5f8522e1ded50d7a1 /src
parent0c8d172cf34f442a1318388f751d7e0f652d7072 (diff)
downloadqtimageformats-43403038cf75086409bf7ee485ae855fd4c1c1e1.tar.gz
Update bundled libtiff to version 4.0.10
[ChangeLog][Third-Party Code] Bundled libtiff was updated to version 4.0.10 Change-Id: Ib1908d09fc5847381cb03418de878fafd2001a30 Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/libtiff/ChangeLog715
-rw-r--r--src/3rdparty/libtiff/RELEASE-DATE2
-rw-r--r--src/3rdparty/libtiff/TODO2
-rw-r--r--src/3rdparty/libtiff/VERSION2
-rw-r--r--src/3rdparty/libtiff/libtiff/SConstruct2
-rw-r--r--src/3rdparty/libtiff/libtiff/mkg3states.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/t4.h2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_aux.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_close.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_codec.c10
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_color.c4
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_compress.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_config.h.in60
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_config.wince.h2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_dir.c29
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_dir.h6
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_dirinfo.c17
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_dirread.c107
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_dirwrite.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_dumpmode.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_error.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_extension.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_fax3.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_fax3.h2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_flush.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_getimage.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_jbig.c34
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_jpeg.c6
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_luv.c12
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_lzma.c11
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_lzw.c14
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_next.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_ojpeg.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_open.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_packbits.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_pixarlog.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_predict.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_predict.h6
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_print.c4
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_read.c13
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_stream.cxx8
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_strip.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_swab.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_thunder.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_tile.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_unix.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_version.c1
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_warning.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_win32.c41
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_write.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_zip.c2
-rw-r--r--src/3rdparty/libtiff/libtiff/tiff.h18
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffconf.h.in9
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffconf.vc.h9
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffconf.wince.h11
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffio.h4
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffio.hxx3
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffiop.h15
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffvers.h4
-rw-r--r--src/3rdparty/libtiff/port/dummy.c2
-rw-r--r--src/3rdparty/libtiff/port/getopt.c2
-rw-r--r--src/3rdparty/libtiff/port/lfind.c2
-rw-r--r--src/3rdparty/libtiff/port/libport.h13
-rw-r--r--src/3rdparty/libtiff/port/strcasecmp.c2
-rw-r--r--src/3rdparty/libtiff/port/strtoul.c91
-rw-r--r--src/3rdparty/libtiff/port/strtoull.c107
-rw-r--r--src/3rdparty/libtiff/qt_attribution.json2
67 files changed, 987 insertions, 469 deletions
diff --git a/src/3rdparty/libtiff/ChangeLog b/src/3rdparty/libtiff/ChangeLog
index ea8622b..1f50e20 100644
--- a/src/3rdparty/libtiff/ChangeLog
+++ b/src/3rdparty/libtiff/ChangeLog
@@ -1,3 +1,698 @@
+2018-11-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ * configure.ac: libtiff 4.0.10 released.
+
+ Change COMPRESSION_ZSTD to 50000 and COMPRESSION_WEBP to 50001.
+
+2018-11-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Added preliminary release notes for release 4.0.10.
+
+2018-11-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ tiff2pdf: Eliminate compiler warning about snprintf output truncation when formatting pdf_datetime.
+
+2018-11-03 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'no_tif_platform_console' into 'master'
+ Remove builtin support for GUI warning and error message boxes
+
+ See merge request libtiff/libtiff!24
+
+2018-11-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ tiffcrop.c: Eliminate compiler warning about snprintf output truncation when formatting filenum.
+
+ TWebPVGetField(): Add apparently missing break statement impacting TIFFTAG_WEBP_LOSSLESS.
+
+ Eliminate compiler warnings about duplicate definitions of streq/strneq macros.
+
+ Ignore generated files.
+
+ Remove and ignore files which are a product of autogen.sh.
+
+2018-11-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Fix TIFFErrorExt() formatting of size_t type for 32-bit compiles.
+
+2018-10-30 Even Rouault <even.rouault@spatialys.com>
+
+ tiff2bw: avoid null pointer dereference in case of out of memory situation. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2819 / CVE-2018-18661
+
+ tiffio.h: fix comment.
+
+2018-10-26 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'header2' into 'master'
+ Fix 725279bd: Standalone tif_predict.h: tiff.h should be tiffiop.h
+
+ See merge request libtiff/libtiff!41
+
+2018-10-26 Kurt Schwehr <schwehr@google.com>
+
+ Fix 725279bd: Standalone tif_predict.h: tiff.h should be tiffiop.h.
+
+2018-10-25 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'headers' into 'master'
+ Add includes to headers to allow them to stand alone.
+
+ See merge request libtiff/libtiff!40
+
+2018-10-24 Kurt Schwehr <schwehr@google.com>
+
+ Add includes to headers to allow them to stand alone.
+ This allows compilers that can do header stand alone header parsing
+ to process libtiff.
+
+2018-10-18 Even Rouault <even.rouault@spatialys.com>
+
+ LZMAPreEncode: emit verbose error if lzma_stream_encoder() fails (typically because not enough memory available)
+
+2018-10-17 Even Rouault <even.rouault@spatialys.com>
+
+ tif_webp.c: fix previous commit that broke scanline decoding.
+
+ tif_webp.c: fix potential read outside libwebp buffer on corrupted images
+
+2018-10-14 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'jbig_decode_overflow' into 'master'
+ JBIG: fix potential out-of-bounds write in JBIGDecode()
+
+ See merge request libtiff/libtiff!38
+
+2018-10-14 Even Rouault <even.rouault@spatialys.com>
+
+ JBIG: fix potential out-of-bounds write in JBIGDecode()
+ JBIGDecode doesn't check if the user provided buffer is large enough
+ to store the JBIG decoded image, which can potentially cause out-of-bounds
+ write in the buffer.
+ This issue was reported and analyzed by Thomas Dullien.
+
+ Also fixes a (harmless) potential use of uninitialized memory when
+ tif->tif_rawsize > tif->tif_rawcc
+
+ And in case libtiff is compiled with CHUNKY_STRIP_READ_SUPPORT, make sure
+ that whole strip data is provided to JBIGDecode()
+
+2018-10-05 Even Rouault <even.rouault@spatialys.com>
+
+ tif_webp.c: fix scanline reading/writing.
+
+ WEBP codec: initialize nSamples in TWebPSetupDecode() and TWebPSetupEncode()
+
+2018-10-05 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'tif_webp' into 'master'
+ webp support
+
+ See merge request libtiff/libtiff!32
+
+2018-10-05 Norman Barker <norman.barker@mapbox.com>
+
+ webp in tiff.
+
+2018-09-17 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'master' into 'master'
+ fix three potential vulnerabilities.
+
+ See merge request libtiff/libtiff!33
+
+2018-09-08 Young_X <YangX92@hotmail.com>
+
+ fix out-of-bound read on some tiled images.
+
+ avoid potential int32 overflows in multiply_ms()
+
+ only read/write TIFFTAG_GROUP3OPTIONS or TIFFTAG_GROUP4OPTIONS if compression is COMPRESSION_CCITTFAX3 or COMPRESSION_CCITTFAX4
+
+2018-08-15 Even Rouault <even.rouault@spatialys.com>
+
+ TIFFSetupStrips(): avoid potential uint32 overflow on 32-bit systems with large number of strips. Probably relates to http://bugzilla.maptools.org/show_bug.cgi?id=2788 / CVE-2018-10779
+
+2018-08-07 Even Rouault <even.rouault@spatialys.com>
+
+ ZSTD: fix flush issue that can cause endless loop in ZSTDEncode()
+ Fixes https://github.com/OSGeo/gdal/issues/833
+
+2018-08-07 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'fix_bug_2800' into 'master'
+ Fix libtiff 4.0.8 regression when reading LZW-compressed strips with scanline API
+
+ See merge request libtiff/libtiff!31
+
+2018-08-07 Even Rouault <even.rouault@spatialys.com>
+
+ Fix libtiff 4.0.8 regression when reading LZW-compressed strips with scanline API
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2800
+
+2018-07-05 Even Rouault <even.rouault@spatialys.com>
+
+ Add tag and pseudo-tag definitions for ESRI LERC codec (out of tree codec whose source is at https://github.com/OSGeo/gdal/blob/master/gdal/frmts/gtiff/tif_lerc.c)
+
+2018-07-02 Even Rouault <even.rouault@spatialys.com>
+
+ Fix TIFFTAG_ZSTD_LEVEL pseudo tag value to be > 65536, and the next one in the series
+
+2018-05-25 Stefan Weil <sw@weilnetz.de>
+
+ Remove builtin support for GUI warning and error message boxes.
+ Now warnings always go to the console by default unless applications
+ define their own warning and error handlers.
+
+ GUI applications (and Windows CE) are required to define such handlers.
+
+2018-05-12 Even Rouault <even.rouault@spatialys.com>
+
+ LZWDecodeCompat(): fix potential index-out-of-bounds write. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2780 / CVE-2018-8905
+ The fix consists in using the similar code LZWDecode() to validate we
+ don't write outside of the output buffer.
+
+ TIFFFetchNormalTag(): avoid (probably false positive) clang-tidy clang-analyzer-core.NullDereference warnings
+
+ TIFFWriteDirectorySec: avoid assertion. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2795. CVE-2018-10963
+
+2018-05-04 Even Rouault <even.rouault@spatialys.com>
+
+ tif_color.c: fix code comment.
+
+2018-04-17 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'fuzzer-fix' into 'master'
+ remove a pointless multiplication and a variable that's not necessary
+
+ See merge request libtiff/libtiff!29
+
+2018-04-17 Paul Kehrer <paul.l.kehrer@gmail.com>
+
+ remove a pointless multiplication and a variable that's not necessary.
+
+2018-04-17 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'ossfuzz' into 'master'
+ move oss-fuzz build script and fuzzer into libtiff tree
+
+ See merge request libtiff/libtiff!28
+
+2018-04-17 Paul Kehrer <paul.l.kehrer@gmail.com>
+
+ move oss-fuzz build script and fuzzer into libtiff tree.
+
+2018-04-14 Even Rouault <even.rouault@spatialys.com>
+
+ _TIFFGetMaxColorChannels: update for LOGLUV, ITULAB and ICCLAB that have 3 color channels
+
+2018-04-12 Even Rouault <even.rouault@spatialys.com>
+
+ Fix MSVC warning.
+
+2018-04-12 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'master' into 'master'
+ Fix NULL pointer dereference in TIFFPrintDirectory (bugzilla 2778/CVE-2018-7456)
+
+ See merge request libtiff/libtiff!27
+
+2018-04-11 Hugo Lefeuvre <hle@debian.org>
+
+ Fix NULL pointer dereference in TIFFPrintDirectory.
+ The TIFFPrintDirectory function relies on the following assumptions,
+ supposed to be guaranteed by the specification:
+
+ (a) A Transfer Function field is only present if the TIFF file has
+ photometric type < 3.
+
+ (b) If SamplesPerPixel > Color Channels, then the ExtraSamples field
+ has count SamplesPerPixel - (Color Channels) and contains
+ information about supplementary channels.
+
+ While respect of (a) and (b) are essential for the well functioning of
+ TIFFPrintDirectory, no checks are realized neither by the callee nor
+ by TIFFPrintDirectory itself. Hence, following scenarios might happen
+ and trigger the NULL pointer dereference:
+
+ (1) TIFF File of photometric type 4 or more has illegal Transfer
+ Function field.
+
+ (2) TIFF File has photometric type 3 or less and defines a
+ SamplesPerPixel field such that SamplesPerPixel > Color Channels
+ without defining all extra samples in the ExtraSamples fields.
+
+ In this patch, we address both issues with respect of the following
+ principles:
+
+ (A) In the case of (1), the defined transfer table should be printed
+ safely even if it isn't 'legal'. This allows us to avoid expensive
+ checks in TIFFPrintDirectory. Also, it is quite possible that
+ an alternative photometric type would be developed (not part of the
+ standard) and would allow definition of Transfer Table. We want
+ libtiff to be able to handle this scenario out of the box.
+
+ (B) In the case of (2), the transfer table should be printed at its
+ right size, that is if TIFF file has photometric type Palette
+ then the transfer table should have one row and not three, even
+ if two extra samples are declared.
+
+ In order to fulfill (A) we simply add a new 'i < 3' end condition to
+ the broken TIFFPrintDirectory loop. This makes sure that in any case
+ where (b) would be respected but not (a), everything stays fine.
+
+ (B) is fulfilled by the loop condition
+ 'i < td->td_samplesperpixel - td->td_extrasamples'. This is enough as
+ long as (b) is respected.
+
+ Naturally, we also make sure (b) is respected. This is done in the
+ TIFFReadDirectory function by making sure any non-color channel is
+ counted in ExtraSamples.
+
+ This commit addresses CVE-2018-7456.
+
+2018-03-27 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'tiffset-long8' into 'master'
+ tiffset: Add support for LONG8, SLONG8 and IFD8 field types
+
+ See merge request libtiff/libtiff!25
+
+2018-03-26 Roger Leigh <rleigh@codelibre.net>
+
+ port: Clean up NetBSD sources and headers to build standalone.
+
+2018-03-23 Roger Leigh <rleigh@dundee.ac.uk>
+
+ port: Add strtol, strtoll and strtoull.
+ Also update strtoul. All use the same implementation from NetBSD libc.
+
+ tiffset: Add support for LONG8, SLONG8 and IFD8 field types.
+
+2018-03-17 Even Rouault <even.rouault@spatialys.com>
+
+ ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+ Rework fix done in 3719385a3fac5cfb20b487619a5f08abbf967cf8 to work in more
+ cases like https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6979.
+ Credit to OSS Fuzz
+
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2724
+
+2018-03-13 Even Rouault <even.rouault@spatialys.com>
+
+ libtiff/tif_luv.c: rewrite loops in a more readable way (to avoid false positive reports like http://bugzilla.maptools.org/show_bug.cgi?id=2779)
+
+2018-03-13 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'avoid_memory_exhaustion_in_ChopUpSingleUncompressedStrip' into 'master'
+ ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+
+ See merge request libtiff/libtiff!26
+
+2018-03-11 Even Rouault <even.rouault@spatialys.com>
+
+ ChopUpSingleUncompressedStrip: avoid memory exhaustion (CVE-2017-11613)
+ In ChopUpSingleUncompressedStrip(), if the computed number of strips is big
+ enough and we are in read only mode, validate that the file size is consistent
+ with that number of strips to avoid useless attempts at allocating a lot of
+ memory for the td_stripbytecount and td_stripoffset arrays.
+
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2724
+
+2018-03-10 Even Rouault <even.rouault@spatialys.com>
+
+ Typo fix in comment.
+
+2018-03-03 Even Rouault <even.rouault@spatialys.com>
+
+ Avoid warning with gcc 8 (partially revert 647b0e8c11ee11896f319b92cf110775f538d75c)
+
+2018-02-25 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'typos' into 'master'
+ Fix some typos
+
+ See merge request libtiff/libtiff!23
+
+2018-02-24 Stefan Weil <sw@weilnetz.de>
+
+ Fix some typos.
+ Most of them were found by codespell.
+
+2018-02-14 Even Rouault <even.rouault@spatialys.com>
+
+ Typo fix in comment.
+
+ Merge branch 'zstd'
+
+ Add warning about COMPRESSION_ZSTD not being officialy registered.
+
+2018-02-14 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'bug2772' into 'master'
+ Fix for bug 2772
+
+ See merge request libtiff/libtiff!20
+
+2018-02-12 Nathan Baker <nathanb@lenovo-chrome.com>
+
+ Fix for bug 2772.
+ It is possible to craft a TIFF document where the IFD list is circular,
+ leading to an infinite loop while traversing the chain. The libtiff
+ directory reader has a failsafe that will break out of this loop after
+ reading 65535 directory entries, but it will continue processing,
+ consuming time and resources to process what is essentially a bogus TIFF
+ document.
+
+ This change fixes the above behavior by breaking out of processing when
+ a TIFF document has >= 65535 directories and terminating with an error.
+
+2018-02-09 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'libtiff-as-subdirectory-fixes' into 'master'
+ Prefer target_include_directories
+
+ See merge request libtiff/libtiff!12
+
+2018-02-06 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'cmake-cleanups' into 'master'
+ Cmake cleanups
+
+ See merge request libtiff/libtiff!11
+
+2018-02-06 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'check-right-cxx-variable' into 'master'
+ Check right cxx variable
+
+ See merge request libtiff/libtiff!19
+
+2018-02-06 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'dont-leak-stream-open' into 'master'
+ Fix a memory leak in TIFFStreamOpen
+
+ See merge request libtiff/libtiff!17
+
+2018-02-06 Ben Boeckel <ben.boeckel@kitware.com>
+
+ cmake: check CXX_SUPPORT.
+ This variable is set in response to the `cxx` cache variable; use it
+ instead.
+
+2018-02-04 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'warnings' into 'master'
+ Fix all compiler warnings for default build
+
+ See merge request libtiff/libtiff!16
+
+2018-02-04 Nathan Baker <elitebadger@gmail.com>
+
+ Fix all compiler warnings for default build.
+
+2018-01-30 Paul Kehrer <paul.l.kehrer@gmail.com>
+
+ tabs are hard.
+
+2018-01-29 Paul Kehrer <paul.l.kehrer@gmail.com>
+
+ use hard tabs like the rest of the project.
+
+ Fix a memory leak in TIFFStreamOpen.
+ TIFFStreamOpen allocates a new tiff{o,i}s_data, but if TIFFClientOpen
+ fails then that struct is leaked. Delete it if the returned TIFF * is
+ null.
+
+2018-01-29 Kevin Funk <kfunk@kde.org>
+
+ Bump minimum required CMake version to v2.8.11.
+ Because we use the BUILD_INTERFACE generator expression
+
+2018-01-27 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'patch-1' into 'master'
+ Update CMakeLists.txt for build fix on Windows
+
+ See merge request libtiff/libtiff!14
+
+2018-01-27 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'patch-2' into 'master'
+ Update tiffgt.c for build fix on Windows
+
+ See merge request libtiff/libtiff!13
+
+2018-01-25 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'bug2750' into 'master'
+ Add workaround to pal2rgb buffer overflow.
+
+ See merge request libtiff/libtiff!15
+
+2018-01-25 Nathan Baker <elitebadger@gmail.com>
+
+ Add workaround to pal2rgb buffer overflow.
+
+2018-01-23 Andrea <andrea@andreaplanet.com>
+
+ Update tiffgt.c for build fix on Windows.
+
+ Update CMakeLists.txt for build fix on Windows.
+
+2018-01-15 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'has-attribute-check' into 'master'
+ tiffiop: use __has_attribute to detect the no_sanitize attribute
+
+ See merge request libtiff/libtiff!10
+
+2018-01-15 Ben Boeckel <ben.boeckel@kitware.com>
+
+ cmake: avoid setting hard-coded variables in the cache.
+
+ cmake: avoid an unnecessary intermediate variable.
+
+ cmake: avoid an unnecessary intermediate variable.
+
+ cmake: avoid tautological logic.
+
+ cmake: use check_symbol_exists.
+ This accounts for symbols being provided by macros.
+
+ cmake: remove unused configure checks.
+
+2018-01-12 Kevin Funk <kfunk@kde.org>
+
+ Prefer target_include_directories.
+ When libtiff is included in a super project via a simple
+ `add_subdirectory(libtiff)`, this way the `tiff` library target has all
+ the necessary information to build against it.
+
+ Note: The BUILD_INTERFACE generator expression feature requires at least
+ CMake v2.8.11 if I'm correct.
+
+2018-01-09 Ben Boeckel <ben.boeckel@kitware.com>
+
+ tiffiop: use __has_attribute to detect the no_sanitize attribute.
+
+2017-12-31 Even Rouault <even.rouault@spatialys.com>
+
+ man/TIFFquery.3tiff: remove reference to non-existing TIFFReadStrip() function in TIFFIsByteSwapped() documentation. Patch by Eric Piel. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2763
+
+ libtiff/tif_dir.c: _TIFFVGetField(): fix heap out-of-bounds access when requesting TIFFTAG_NUMBEROFINKS on a EXIF directory. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2765. Reported by Google Autofuzz project
+
+ libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer dereference on corrupted file. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2770
+
+2017-12-21 Even Rouault <even.rouault@spatialys.com>
+
+ Add libzstd to gitlab-ci.
+
+2017-12-21 Even Rouault <even.rouault@spatialys.com>
+
+ Add ZSTD compression codec.
+ From https://github.com/facebook/zstd
+ "Zstandard, or zstd as short version, is a fast lossless compression
+ algorithm, targeting real-time compression scenarios at zlib-level
+ and better compression ratios. It's backed by a very fast entropy stage,
+ provided by Huff0 and FSE library."
+
+ We require libzstd >= 1.0.0 so as to be able to use streaming compression
+ and decompression methods.
+
+ The default compression level we have selected is 9 (range goes from 1 to 22),
+ which experimentally offers equivalent or better compression ratio than
+ the default deflate/ZIP level of 6, and much faster compression.
+
+ For example on a 6600x4400 16bit image, tiffcp -c zip runs in 10.7 seconds,
+ while tiffcp -c zstd runs in 5.3 seconds. Decompression time for zip is
+ 840 ms, and for zstd 650 ms. File size is 42735936 for zip, and
+ 42586822 for zstd. Similar findings on other images.
+
+ On a 25894x16701 16bit image,
+
+ Compression time Decompression time File size
+
+ ZSTD 35 s 3.2 s 399 700 498
+ ZIP/Deflate 1m 20 s 4.9 s 419 622 336
+
+2017-12-10 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'fix_cve-2017-9935' into 'master'
+ Fix CVE-2017-9935
+
+ See merge request libtiff/libtiff!7
+
+2017-12-10 Brian May <brian@linuxpenguins.xyz>
+
+ tiff2pdf: Fix apparent incorrect type for transfer table.
+ The standard says the transfer table contains unsigned 16 bit values,
+ I have no idea why we refer to them as floats.
+
+2017-12-10 Brian May <brian@linuxpenguins.xyz>
+
+ tiff2pdf: Fix CVE-2017-9935.
+ Fix for http://bugzilla.maptools.org/show_bug.cgi?id=2704
+
+ This vulnerability - at least for the supplied test case - is because we
+ assume that a tiff will only have one transfer function that is the same
+ for all pages. This is not required by the TIFF standards.
+
+ We than read the transfer function for every page. Depending on the
+ transfer function, we allocate either 2 or 4 bytes to the XREF buffer.
+ We allocate this memory after we read in the transfer function for the
+ page.
+
+ For the first exploit - POC1, this file has 3 pages. For the first page
+ we allocate 2 extra extra XREF entries. Then for the next page 2 more
+ entries. Then for the last page the transfer function changes and we
+ allocate 4 more entries.
+
+ When we read the file into memory, we assume we have 4 bytes extra for
+ each and every page (as per the last transfer function we read). Which
+ is not correct, we only have 2 bytes extra for the first 2 pages. As a
+ result, we end up writing past the end of the buffer.
+
+ There are also some related issues that this also fixes. For example,
+ TIFFGetField can return uninitalized pointer values, and the logic to
+ detect a N=3 vs N=1 transfer function seemed rather strange.
+
+ It is also strange that we declare the transfer functions to be of type
+ float, when the standard says they are unsigned 16 bit values. This is
+ fixed in another patch.
+
+ This patch will check to ensure that the N value for every transfer
+ function is the same for every page. If this changes, we abort with an
+ error. In theory, we should perhaps check that the transfer function
+ itself is identical for every page, however we don't do that due to the
+ confusion of the type of the data in the transfer function.
+
+2017-12-10 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'undef-warn-fixes' into 'master'
+ Fix a couple of harmless but annoying -Wundef warnings
+
+ See merge request libtiff/libtiff!8
+
+2017-12-07 Vadim Zeitlin <vadim@zeitlins.org>
+
+ Remove tests for undefined SIZEOF_VOIDP.
+ As configure never uses AC_CHECK_SIZEOF(void*), this symbol is never
+ defined and so it doesn't make sense to test it in the code, this just
+ results in -Wundef warnings if they're enabled.
+
+ Avoid harmless -Wundef warnings for __clang_major__
+ Check that we're using Clang before checking its version.
+
+2017-12-02 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'remove_autogenerated_files' into 'master'
+ Remove autogenerated files
+
+ See merge request libtiff/libtiff!5
+
+2017-12-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Merge branch 'tif_config_h_includes' into 'master'
+ 'tif_config.h' or 'tiffiop.h' must be included before any system header.
+
+ See merge request libtiff/libtiff!6
+
+2017-12-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ 'tif_config.h' or 'tiffio.h' must be included before any system header.
+
+2017-12-01 Even Rouault <even.rouault@spatialys.com>
+
+ .gitignore: add patterns for build from root.
+
+ Remove remaining .cvsignore files.
+
+ Remove autoconf/automake generated files, and add them to .gitignore.
+
+2017-12-01 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'makedistcheck' into 'master'
+ build/gitlab-ci and build/travis-ci: add a 'make dist' step in autoconf_build()…
+
+ See merge request libtiff/libtiff!4
+
+2017-12-01 Even Rouault <even.rouault@spatialys.com>
+
+ build/gitlab-ci and build/travis-ci: add a 'make dist' step in autoconf_build() target, to check we are release-ready
+
+2017-12-01 Even Rouault <even.rouault@mines-paris.org>
+
+ Merge branch 'git_updates' into 'master'
+ CVS to Git updates
+
+ See merge request libtiff/libtiff!2
+
+2017-12-01 Even Rouault <even.rouault@spatialys.com>
+
+ HOWTO-RELEASE: update to use signed tags.
+
+ README.md: use markdown syntax for hyperlinks.
+
+2017-11-30 Even Rouault <even.rouault@spatialys.com>
+
+ Add .gitignore.
+
+ Regenerate autoconf files.
+
+ Makefile.am: update to reflect removal of README.vms and README -> README.md
+
+ Remove all $Id and $Headers comments with CVS versions.
+
+ HOWTO-RELEASE: update for git.
+
+ Remove outdated .cvsignore.
+
+ Remove outdated commit script.
+
+ Remove README.vms.
+
+ Rename README as README.md, and update content.
+
+ html/index.html: reflect change from CVS to gitlab.
+
+2017-11-30 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'test-ci' into 'master'
+ Update CI configuration
+
+ See merge request libtiff/libtiff!1
+
+2017-11-23 Roger Leigh <rleigh@codelibre.net>
+
+ appveyor: Correct path for git clone and skip artefact archival.
+
+2017-11-22 Roger Leigh <rleigh@codelibre.net>
+
+ travis-ci: Remove unused matrix exclusion.
+
+ Add gitlab-ci build support.
+
2017-11-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* configure.ac: libtiff 4.0.9 released.
@@ -1849,7 +2544,7 @@
* libtiff/tif_jpeg.c: in JPEGFixupTags(), recognize SOF2, SOF9 and SOF10
markers to avoid emitting a warning (even if, according to the TechNote,
- there are admitedly unusual/not recommended or even forbidden variants, but
+ there are admittedly unusual/not recommended or even forbidden variants, but
they do work well with libjpeg for SOF2, and with libjpeg-turbo for SOF2,
SOF9 and SOF10).
Define in_color_space and input_components to the right values in
@@ -2432,7 +3127,7 @@
2012-05-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* man/TIFFGetField.3tiff: Correct the 'count' field type in the
- example for how to retreive the value of unsupported tags.
+ example for how to retrieve the value of unsupported tags.
2012-03-30 Frank Warmerdam <warmerdam@google.com>
@@ -3039,7 +3734,7 @@
2010-04-21 Frank Warmerdam <warmerdam@pobox.com>
- * libtiff/tif_jpeg.c: avoid preparing jpeg tables everytime
+ * libtiff/tif_jpeg.c: avoid preparing jpeg tables every time
JPEGSetupEncode() is called if the tables already seem to be
established. This prevents spurious updates and rewriting of
directories with jpegtables when doing updates to existing images.
@@ -3371,7 +4066,7 @@
* test/common.sh - start verbose mode after common settings.
- * libtiff/tif_dirinfo.c: Replace lfind() with local equivelent to
+ * libtiff/tif_dirinfo.c: Replace lfind() with local equivalent to
avoid type mismatches on different platforms.
http://bugzilla.maptools.org/show_bug.cgi?id=1889
@@ -3518,7 +4213,7 @@
* tools/tiffdump.c: When compiling for Microsoft Windows, apply
consistent (__int64) casting when testing if _lseeki64 has
- successfully seeked as requested. This is necessary for large
+ successfully sought as requested. This is necessary for large
file support to work since off_t is only 32-bit.
2008-07-29 Frank Warmerdam <warmerdam@pobox.com>
@@ -4316,7 +5011,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
* libtiff/tif_getimage.c: replaced usage of TIFFScanlineSize in
gtStripContig with TIFFNewScanlineSize so as to fix buggy behaviour
on subsampled images - this ought to get sorted when we feel brave
- enough to replace TIFFScanlineSize alltogether
+ enough to replace TIFFScanlineSize altogether
* libtiff/tif_ojpeg.c: fixed bug in OJPEGReadSkip
@@ -4974,7 +5669,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2005-06-03 Andrey Kiselev <dron@ak4719.spb.edu>
- * libtiff/tif_open.c: Replace runtime endianess check with the compile
+ * libtiff/tif_open.c: Replace runtime endianness check with the compile
time one.
* libtiff/tif_predict.c: Floating point predictor now works on
@@ -6316,7 +7011,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2003-11-16 Andrey Kiselev <dron@ak4719.spb.edu>
* libtiff/{tiff.h, tif_dirinfo.c}: Added support for IFD (13)
- datatype, intruduced in "Adobe PageMaker TIFF Tech. Notes".
+ datatype, introduced in "Adobe PageMaker TIFF Tech. Notes".
2003-11-15 Frank Warmerdam <warmerdam@pobox.com>
@@ -6627,7 +7322,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
* contrib/ojpeg/{Makefile.in, jdhuff.h, jinclude.h, ojpeg.c, README},
configure, Makefile.in: Improved libtiff compilation with OJPEG
- support. Now no need for patching IJG JPEG library, hack requred by
+ support. Now no need for patching IJG JPEG library, hack required by
libtiff will be compiled and used in-place. Implemented with
suggestion and help from Bill Allombert, Debian's libjpeg maintainer.
@@ -7485,7 +8180,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
sizes. It fixes two problems:
Without scaling (-S) the fax is now centered on the page size specified
- with -H and/or -W. Before, fax2ps was using an obscure and practially
+ with -H and/or -W. Before, fax2ps was using an obscure and practically
useless algorithm to allocate the image relative to Letter sized paper
which sometime sled to useless whitespace on the paper, while at the
same time cutting of the faxes printable area at the opposite border.
diff --git a/src/3rdparty/libtiff/RELEASE-DATE b/src/3rdparty/libtiff/RELEASE-DATE
index f5a5ad7..94d1f0c 100644
--- a/src/3rdparty/libtiff/RELEASE-DATE
+++ b/src/3rdparty/libtiff/RELEASE-DATE
@@ -1 +1 @@
-20171118
+20181110
diff --git a/src/3rdparty/libtiff/TODO b/src/3rdparty/libtiff/TODO
index 2ff8627..ea266aa 100644
--- a/src/3rdparty/libtiff/TODO
+++ b/src/3rdparty/libtiff/TODO
@@ -1,5 +1,3 @@
-# $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
o YCbCr sampling support
diff --git a/src/3rdparty/libtiff/VERSION b/src/3rdparty/libtiff/VERSION
index 7919852..2d2d681 100644
--- a/src/3rdparty/libtiff/VERSION
+++ b/src/3rdparty/libtiff/VERSION
@@ -1 +1 @@
-4.0.9
+4.0.10
diff --git a/src/3rdparty/libtiff/libtiff/SConstruct b/src/3rdparty/libtiff/libtiff/SConstruct
index cb6a7cc..af3daac 100644
--- a/src/3rdparty/libtiff/libtiff/SConstruct
+++ b/src/3rdparty/libtiff/libtiff/SConstruct
@@ -1,5 +1,3 @@
-# $Id: SConstruct,v 1.4 2007/02/24 15:03:50 dron Exp $
-
# Tag Image File Format (TIFF) Software
#
# Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
diff --git a/src/3rdparty/libtiff/libtiff/mkg3states.c b/src/3rdparty/libtiff/libtiff/mkg3states.c
index 16ad3c2..54fc059 100644
--- a/src/3rdparty/libtiff/libtiff/mkg3states.c
+++ b/src/3rdparty/libtiff/libtiff/mkg3states.c
@@ -1,5 +1,3 @@
-/* "$Id: mkg3states.c,v 1.12 2015-06-21 01:09:09 bfriesen Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/t4.h b/src/3rdparty/libtiff/libtiff/t4.h
index b908f54..fb0951a 100644
--- a/src/3rdparty/libtiff/libtiff/t4.h
+++ b/src/3rdparty/libtiff/libtiff/t4.h
@@ -1,5 +1,3 @@
-/* $Id: t4.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_aux.c b/src/3rdparty/libtiff/libtiff/tif_aux.c
index 10b8d00..4ece162 100644
--- a/src/3rdparty/libtiff/libtiff/tif_aux.c
+++ b/src/3rdparty/libtiff/libtiff/tif_aux.c
@@ -1,5 +1,3 @@
-/* $Id: tif_aux.c,v 1.31 2017-11-17 20:21:00 erouault Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_close.c b/src/3rdparty/libtiff/libtiff/tif_close.c
index a0cb661..e4228df 100644
--- a/src/3rdparty/libtiff/libtiff/tif_close.c
+++ b/src/3rdparty/libtiff/libtiff/tif_close.c
@@ -1,5 +1,3 @@
-/* $Id: tif_close.c,v 1.21 2016-01-23 21:20:34 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_codec.c b/src/3rdparty/libtiff/libtiff/tif_codec.c
index 7cb46f6..b6c04f0 100644
--- a/src/3rdparty/libtiff/libtiff/tif_codec.c
+++ b/src/3rdparty/libtiff/libtiff/tif_codec.c
@@ -1,5 +1,3 @@
-/* $Id: tif_codec.c,v 1.17 2015-08-19 02:31:04 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -72,6 +70,12 @@ static int NotConfigured(TIFF*, int);
#ifndef LZMA_SUPPORT
#define TIFFInitLZMA NotConfigured
#endif
+#ifndef ZSTD_SUPPORT
+#define TIFFInitZSTD NotConfigured
+#endif
+#ifndef WEBP_SUPPORT
+#define TIFFInitWebP NotConfigured
+#endif
/*
* Compression schemes statically built into the library.
@@ -99,6 +103,8 @@ TIFFCodec _TIFFBuiltinCODECS[] = {
{ "SGILog", COMPRESSION_SGILOG, TIFFInitSGILog },
{ "SGILog24", COMPRESSION_SGILOG24, TIFFInitSGILog },
{ "LZMA", COMPRESSION_LZMA, TIFFInitLZMA },
+ { "ZSTD", COMPRESSION_ZSTD, TIFFInitZSTD },
+ { "WEBP", COMPRESSION_WEBP, TIFFInitWebP },
{ NULL, 0, NULL }
};
diff --git a/src/3rdparty/libtiff/libtiff/tif_color.c b/src/3rdparty/libtiff/libtiff/tif_color.c
index 71cafcd..8fae40e 100644
--- a/src/3rdparty/libtiff/libtiff/tif_color.c
+++ b/src/3rdparty/libtiff/libtiff/tif_color.c
@@ -1,5 +1,3 @@
-/* $Id: tif_color.c,v 1.24 2017-05-29 10:12:54 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -168,7 +166,7 @@ TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab,
}
/*
- * Convert color value from the YCbCr space to CIE XYZ.
+ * Convert color value from the YCbCr space to RGB.
* The colorspace conversion algorithm comes from the IJG v5a code;
* see below for more information on how it works.
*/
diff --git a/src/3rdparty/libtiff/libtiff/tif_compress.c b/src/3rdparty/libtiff/libtiff/tif_compress.c
index b571d19..8130ef0 100644
--- a/src/3rdparty/libtiff/libtiff/tif_compress.c
+++ b/src/3rdparty/libtiff/libtiff/tif_compress.c
@@ -1,5 +1,3 @@
-/* $Id: tif_compress.c,v 1.25 2016-10-25 20:04:22 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h.in b/src/3rdparty/libtiff/libtiff/tif_config.h.in
index a4b2e60..eae07aa 100644
--- a/src/3rdparty/libtiff/libtiff/tif_config.h.in
+++ b/src/3rdparty/libtiff/libtiff/tif_config.h.in
@@ -37,9 +37,6 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define to 1 if you have the `floor' function. */
-#undef HAVE_FLOOR
-
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
@@ -62,45 +59,21 @@
machine */
#undef HAVE_IEEEFP
-/* Define to 1 if the system has the type `int16'. */
-#undef HAVE_INT16
-
-/* Define to 1 if the system has the type `int32'. */
-#undef HAVE_INT32
-
-/* Define to 1 if the system has the type `int8'. */
-#undef HAVE_INT8
-
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <io.h> header file. */
#undef HAVE_IO_H
-/* Define to 1 if you have the `isascii' function. */
-#undef HAVE_ISASCII
-
/* Define to 1 if you have the `jbg_newlen' function. */
#undef HAVE_JBG_NEWLEN
/* Define to 1 if you have the `lfind' function. */
#undef HAVE_LFIND
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
@@ -110,9 +83,6 @@
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
#undef HAVE_OPENGL_GL_H
-/* Define to 1 if you have the `pow' function. */
-#undef HAVE_POW
-
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
@@ -125,9 +95,6 @@
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
-/* Define to 1 if you have the `sqrt' function. */
-#undef HAVE_SQRT
-
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -137,24 +104,18 @@
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
-/* Define to 1 if you have the `strchr' function. */
-#undef HAVE_STRCHR
-
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define to 1 if you have the `strrchr' function. */
-#undef HAVE_STRRCHR
-
-/* Define to 1 if you have the `strstr' function. */
-#undef HAVE_STRSTR
-
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
+/* Define to 1 if you have the `strtoll' function. */
+#undef HAVE_STRTOLL
+
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
@@ -164,9 +125,6 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
@@ -259,9 +217,6 @@
/* The size of `signed long long', as computed by sizeof. */
#undef SIZEOF_SIGNED_LONG_LONG
-/* The size of `signed short', as computed by sizeof. */
-#undef SIZEOF_SIGNED_SHORT
-
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
@@ -277,9 +232,6 @@
/* The size of `unsigned long long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG_LONG
-/* The size of `unsigned short', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_SHORT
-
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -362,6 +314,9 @@
/* Version number of package */
#undef VERSION
+/* Support webp compression */
+#undef WEBP_SUPPORT
+
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
@@ -380,6 +335,9 @@
/* Support Deflate compression */
#undef ZIP_SUPPORT
+/* Support zstd compression */
+#undef ZSTD_SUPPORT
+
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
diff --git a/src/3rdparty/libtiff/libtiff/tif_config.wince.h b/src/3rdparty/libtiff/libtiff/tif_config.wince.h
index 94e92bb..e85e2e6 100644
--- a/src/3rdparty/libtiff/libtiff/tif_config.wince.h
+++ b/src/3rdparty/libtiff/libtiff/tif_config.wince.h
@@ -1,5 +1,3 @@
-/* $Id: tif_config.wince.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */
-
/*
* TIFF library configuration header for Windows CE platform.
*/
diff --git a/src/3rdparty/libtiff/libtiff/tif_dir.c b/src/3rdparty/libtiff/libtiff/tif_dir.c
index f00f808..6f0b487 100644
--- a/src/3rdparty/libtiff/libtiff/tif_dir.c
+++ b/src/3rdparty/libtiff/libtiff/tif_dir.c
@@ -1,5 +1,3 @@
-/* $Id: tif_dir.c,v 1.131 2017-07-11 21:38:04 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -863,14 +861,24 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
if( fip == NULL ) /* cannot happen since TIFFGetField() already checks it */
return 0;
+
+ /*
+ * We want to force the custom code to be used for custom
+ * fields even if the tag happens to match a well known
+ * one - important for reinterpreted handling of standard
+ * tag values in custom directories (i.e. EXIF)
+ */
+ if (fip->field_bit == FIELD_CUSTOM) {
+ standard_tag = 0;
+ }
- if( tag == TIFFTAG_NUMBEROFINKS )
+ if( standard_tag == TIFFTAG_NUMBEROFINKS )
{
int i;
for (i = 0; i < td->td_customValueCount; i++) {
uint16 val;
TIFFTagValue *tv = td->td_customValues + i;
- if (tv->info->field_tag != tag)
+ if (tv->info->field_tag != standard_tag)
continue;
if( tv->value == NULL )
return 0;
@@ -892,16 +900,6 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
return 0;
}
- /*
- * We want to force the custom code to be used for custom
- * fields even if the tag happens to match a well known
- * one - important for reinterpreted handling of standard
- * tag values in custom directories (i.e. EXIF)
- */
- if (fip->field_bit == FIELD_CUSTOM) {
- standard_tag = 0;
- }
-
switch (standard_tag) {
case TIFFTAG_SUBFILETYPE:
*va_arg(ap, uint32*) = td->td_subfiletype;
@@ -1067,6 +1065,9 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
if (td->td_samplesperpixel - td->td_extrasamples > 1) {
*va_arg(ap, uint16**) = td->td_transferfunction[1];
*va_arg(ap, uint16**) = td->td_transferfunction[2];
+ } else {
+ *va_arg(ap, uint16**) = NULL;
+ *va_arg(ap, uint16**) = NULL;
}
break;
case TIFFTAG_REFERENCEBLACKWHITE:
diff --git a/src/3rdparty/libtiff/libtiff/tif_dir.h b/src/3rdparty/libtiff/libtiff/tif_dir.h
index 5a38076..b2f5e69 100644
--- a/src/3rdparty/libtiff/libtiff/tif_dir.h
+++ b/src/3rdparty/libtiff/libtiff/tif_dir.h
@@ -1,5 +1,3 @@
-/* $Id: tif_dir.h,v 1.55 2017-06-01 12:44:04 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -26,6 +24,10 @@
#ifndef _TIFFDIR_
#define _TIFFDIR_
+
+#include "tiff.h"
+#include "tiffio.h"
+
/*
* ``Library-private'' Directory-related Definitions.
*/
diff --git a/src/3rdparty/libtiff/libtiff/tif_dirinfo.c b/src/3rdparty/libtiff/libtiff/tif_dirinfo.c
index 4904f54..e1f6b23 100644
--- a/src/3rdparty/libtiff/libtiff/tif_dirinfo.c
+++ b/src/3rdparty/libtiff/libtiff/tif_dirinfo.c
@@ -1,5 +1,3 @@
-/* $Id: tif_dirinfo.c,v 1.127 2017-06-01 12:44:04 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -979,6 +977,8 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
case TIFFTAG_CONSECUTIVEBADFAXLINES:
case TIFFTAG_GROUP3OPTIONS:
case TIFFTAG_GROUP4OPTIONS:
+ /* LERC */
+ case TIFFTAG_LERC_PARAMETERS:
break;
default:
return 1;
@@ -1054,7 +1054,18 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
if (tag == TIFFTAG_PREDICTOR)
return 1;
break;
-
+ case COMPRESSION_ZSTD:
+ if (tag == TIFFTAG_PREDICTOR)
+ return 1;
+ break;
+ case COMPRESSION_LERC:
+ if (tag == TIFFTAG_LERC_PARAMETERS)
+ return 1;
+ break;
+ case COMPRESSION_WEBP:
+ if (tag == TIFFTAG_PREDICTOR)
+ return 1;
+ break;
}
return 0;
}
diff --git a/src/3rdparty/libtiff/libtiff/tif_dirread.c b/src/3rdparty/libtiff/libtiff/tif_dirread.c
index aa258ba..e80a3b1 100644
--- a/src/3rdparty/libtiff/libtiff/tif_dirread.c
+++ b/src/3rdparty/libtiff/libtiff/tif_dirread.c
@@ -1,5 +1,3 @@
-/* $Id: tif_dirread.c,v 1.218 2017-09-09 21:44:42 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -167,6 +165,7 @@ static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uin
static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
static void ChopUpSingleUncompressedStrip(TIFF*);
static uint64 TIFFReadUInt64(const uint8 *value);
+static int _TIFFGetMaxColorChannels(uint16 photometric);
static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount );
@@ -776,7 +775,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* di
static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
TIFF* tif, uint64 offset, tmsize_t size, void** pdest)
{
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
tmsize_t threshold = INITIAL_THRESHOLD;
#endif
tmsize_t already_read = 0;
@@ -797,7 +796,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
void* new_dest;
tmsize_t bytes_read;
tmsize_t to_read = size - already_read;
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
if( to_read >= threshold && threshold < MAX_THRESHOLD )
{
to_read = threshold;
@@ -3507,6 +3506,35 @@ static void TIFFReadDirEntryOutputErr(TIFF* tif, enum TIFFReadDirEntryErr err, c
}
/*
+ * Return the maximum number of color channels specified for a given photometric
+ * type. 0 is returned if photometric type isn't supported or no default value
+ * is defined by the specification.
+ */
+static int _TIFFGetMaxColorChannels( uint16 photometric )
+{
+ switch (photometric) {
+ case PHOTOMETRIC_PALETTE:
+ case PHOTOMETRIC_MINISWHITE:
+ case PHOTOMETRIC_MINISBLACK:
+ return 1;
+ case PHOTOMETRIC_YCBCR:
+ case PHOTOMETRIC_RGB:
+ case PHOTOMETRIC_CIELAB:
+ case PHOTOMETRIC_LOGLUV:
+ case PHOTOMETRIC_ITULAB:
+ case PHOTOMETRIC_ICCLAB:
+ return 3;
+ case PHOTOMETRIC_SEPARATED:
+ case PHOTOMETRIC_MASK:
+ return 4;
+ case PHOTOMETRIC_LOGL:
+ case PHOTOMETRIC_CFA:
+ default:
+ return 0;
+ }
+}
+
+/*
* Read the next TIFF directory from a file and convert it to the internal
* format. We read directories sequentially.
*/
@@ -3522,6 +3550,7 @@ TIFFReadDirectory(TIFF* tif)
uint32 fii=FAILED_FII;
toff_t nextdiroff;
int bitspersample_read = FALSE;
+ int color_channels;
tif->tif_diroff=tif->tif_nextdiroff;
if (!TIFFCheckDirOffset(tif,tif->tif_nextdiroff))
@@ -4026,6 +4055,37 @@ TIFFReadDirectory(TIFF* tif)
}
}
}
+
+ /*
+ * Make sure all non-color channels are extrasamples.
+ * If it's not the case, define them as such.
+ */
+ color_channels = _TIFFGetMaxColorChannels(tif->tif_dir.td_photometric);
+ if (color_channels && tif->tif_dir.td_samplesperpixel - tif->tif_dir.td_extrasamples > color_channels) {
+ uint16 old_extrasamples;
+ uint16 *new_sampleinfo;
+
+ TIFFWarningExt(tif->tif_clientdata,module, "Sum of Photometric type-related "
+ "color channels and ExtraSamples doesn't match SamplesPerPixel. "
+ "Defining non-color channels as ExtraSamples.");
+
+ old_extrasamples = tif->tif_dir.td_extrasamples;
+ tif->tif_dir.td_extrasamples = (uint16) (tif->tif_dir.td_samplesperpixel - color_channels);
+
+ // sampleinfo should contain information relative to these new extra samples
+ new_sampleinfo = (uint16*) _TIFFcalloc(tif->tif_dir.td_extrasamples, sizeof(uint16));
+ if (!new_sampleinfo) {
+ TIFFErrorExt(tif->tif_clientdata, module, "Failed to allocate memory for "
+ "temporary new sampleinfo array (%d 16 bit elements)",
+ tif->tif_dir.td_extrasamples);
+ goto bad;
+ }
+
+ memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, old_extrasamples * sizeof(uint16));
+ _TIFFsetShortArray(&tif->tif_dir.td_sampleinfo, new_sampleinfo, tif->tif_dir.td_extrasamples);
+ _TIFFfree(new_sampleinfo);
+ }
+
/*
* Verify Palette image has a Colormap.
*/
@@ -4881,17 +4941,18 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
err=TIFFReadDirEntryByteArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
- uint8* ma;
- uint32 mb;
+ uint32 mb = 0;
int n;
- ma=data;
- mb=0;
- while (mb<(uint32)dp->tdir_count)
+ if (data != NULL)
{
- if (*ma==0)
- break;
- ma++;
- mb++;
+ uint8* ma = data;
+ while (mb<(uint32)dp->tdir_count)
+ {
+ if (*ma==0)
+ break;
+ ma++;
+ mb++;
+ }
}
if (mb+1<(uint32)dp->tdir_count)
TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" contains null byte in value; value incorrectly truncated during reading due to implementation limitations",fip->field_name);
@@ -5141,11 +5202,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- if( dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
- {
- TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
- data[dp->tdir_count-1] = '\0';
- }
+ if( data != 0 && dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
+ {
+ TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
+ data[dp->tdir_count-1] = '\0';
+ }
m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
if (data!=0)
_TIFFfree(data);
@@ -5318,11 +5379,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- if( dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
- {
- TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
- data[dp->tdir_count-1] = '\0';
- }
+ if( data != 0 && dp->tdir_count > 0 && data[dp->tdir_count-1] != '\0' )
+ {
+ TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
+ data[dp->tdir_count-1] = '\0';
+ }
m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
if (data!=0)
_TIFFfree(data);
diff --git a/src/3rdparty/libtiff/libtiff/tif_dirwrite.c b/src/3rdparty/libtiff/libtiff/tif_dirwrite.c
index 5d0a669..c15a28d 100644
--- a/src/3rdparty/libtiff/libtiff/tif_dirwrite.c
+++ b/src/3rdparty/libtiff/libtiff/tif_dirwrite.c
@@ -1,5 +1,3 @@
-/* $Id: tif_dirwrite.c,v 1.89 2017-08-23 13:33:42 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_dumpmode.c b/src/3rdparty/libtiff/libtiff/tif_dumpmode.c
index a6a94c0..4a0b07f 100644
--- a/src/3rdparty/libtiff/libtiff/tif_dumpmode.c
+++ b/src/3rdparty/libtiff/libtiff/tif_dumpmode.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dumpmode.c,v 1.15 2015-12-12 18:04:26 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_error.c b/src/3rdparty/libtiff/libtiff/tif_error.c
index 47516b4..651168f 100644
--- a/src/3rdparty/libtiff/libtiff/tif_error.c
+++ b/src/3rdparty/libtiff/libtiff/tif_error.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_error.c,v 1.6 2017-07-04 12:54:42 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_extension.c b/src/3rdparty/libtiff/libtiff/tif_extension.c
index 39fab4c..87d3cfc 100644
--- a/src/3rdparty/libtiff/libtiff/tif_extension.c
+++ b/src/3rdparty/libtiff/libtiff/tif_extension.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_extension.c,v 1.8 2015-12-06 11:13:43 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_fax3.c b/src/3rdparty/libtiff/libtiff/tif_fax3.c
index 5fd5141..d11c968 100644
--- a/src/3rdparty/libtiff/libtiff/tif_fax3.c
+++ b/src/3rdparty/libtiff/libtiff/tif_fax3.c
@@ -1,5 +1,3 @@
-/* $Id: tif_fax3.c,v 1.81 2017-06-18 10:31:50 erouault Exp $ */
-
/*
* Copyright (c) 1990-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_fax3.h b/src/3rdparty/libtiff/libtiff/tif_fax3.h
index 8a43505..abadcd9 100644
--- a/src/3rdparty/libtiff/libtiff/tif_fax3.h
+++ b/src/3rdparty/libtiff/libtiff/tif_fax3.h
@@ -1,5 +1,3 @@
-/* $Id: tif_fax3.h,v 1.13 2016-12-14 18:36:27 faxguy Exp $ */
-
/*
* Copyright (c) 1990-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_flush.c b/src/3rdparty/libtiff/libtiff/tif_flush.c
index fd14e4c..881fac5 100644
--- a/src/3rdparty/libtiff/libtiff/tif_flush.c
+++ b/src/3rdparty/libtiff/libtiff/tif_flush.c
@@ -1,5 +1,3 @@
-/* $Id: tif_flush.c,v 1.9 2010-03-31 06:40:10 fwarmerdam Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_getimage.c b/src/3rdparty/libtiff/libtiff/tif_getimage.c
index fc554cc..6a9d5a7 100644
--- a/src/3rdparty/libtiff/libtiff/tif_getimage.c
+++ b/src/3rdparty/libtiff/libtiff/tif_getimage.c
@@ -1,5 +1,3 @@
-/* $Id: tif_getimage.c,v 1.114 2017-11-17 20:21:00 erouault Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_jbig.c b/src/3rdparty/libtiff/libtiff/tif_jbig.c
index 7a14dd9..7ffe885 100644
--- a/src/3rdparty/libtiff/libtiff/tif_jbig.c
+++ b/src/3rdparty/libtiff/libtiff/tif_jbig.c
@@ -1,5 +1,3 @@
-/* $Id: tif_jbig.c,v 1.16 2017-06-26 15:20:00 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -53,17 +51,18 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
struct jbg_dec_state decoder;
int decodeStatus = 0;
unsigned char* pImage = NULL;
- (void) size, (void) s;
+ unsigned long decodedSize;
+ (void) s;
if (isFillOrder(tif, tif->tif_dir.td_fillorder))
{
- TIFFReverseBits(tif->tif_rawdata, tif->tif_rawdatasize);
+ TIFFReverseBits(tif->tif_rawcp, tif->tif_rawcc);
}
jbg_dec_init(&decoder);
#if defined(HAVE_JBG_NEWLEN)
- jbg_newlen(tif->tif_rawdata, (size_t)tif->tif_rawdatasize);
+ jbg_newlen(tif->tif_rawcp, (size_t)tif->tif_rawcc);
/*
* I do not check the return status of jbg_newlen because even if this
* function fails it does not necessarily mean that decoding the image
@@ -76,8 +75,8 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
*/
#endif /* HAVE_JBG_NEWLEN */
- decodeStatus = jbg_dec_in(&decoder, (unsigned char*)tif->tif_rawdata,
- (size_t)tif->tif_rawdatasize, NULL);
+ decodeStatus = jbg_dec_in(&decoder, (unsigned char*)tif->tif_rawcp,
+ (size_t)tif->tif_rawcc, NULL);
if (JBG_EOK != decodeStatus)
{
/*
@@ -98,9 +97,28 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
return 0;
}
+ decodedSize = jbg_dec_getsize(&decoder);
+ if( (tmsize_t)decodedSize < size )
+ {
+ TIFFWarningExt(tif->tif_clientdata, "JBIG",
+ "Only decoded %lu bytes, whereas %lu requested",
+ decodedSize, (unsigned long)size);
+ }
+ else if( (tmsize_t)decodedSize > size )
+ {
+ TIFFErrorExt(tif->tif_clientdata, "JBIG",
+ "Decoded %lu bytes, whereas %lu were requested",
+ decodedSize, (unsigned long)size);
+ jbg_dec_free(&decoder);
+ return 0;
+ }
pImage = jbg_dec_getimage(&decoder, 0);
- _TIFFmemcpy(buffer, pImage, jbg_dec_getsize(&decoder));
+ _TIFFmemcpy(buffer, pImage, decodedSize);
jbg_dec_free(&decoder);
+
+ tif->tif_rawcp += tif->tif_rawcc;
+ tif->tif_rawcc = 0;
+
return 1;
}
diff --git a/src/3rdparty/libtiff/libtiff/tif_jpeg.c b/src/3rdparty/libtiff/libtiff/tif_jpeg.c
index 0fbdb35..f2ddc33 100644
--- a/src/3rdparty/libtiff/libtiff/tif_jpeg.c
+++ b/src/3rdparty/libtiff/libtiff/tif_jpeg.c
@@ -1,5 +1,3 @@
-/* $Id: tif_jpeg.c,v 1.134 2017-10-17 19:04:47 erouault Exp $ */
-
/*
* Copyright (c) 1994-1997 Sam Leffler
* Copyright (c) 1994-1997 Silicon Graphics, Inc.
@@ -27,9 +25,9 @@
#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN
+#include "tiffiop.h"
#include <stdlib.h>
-#include "tiffiop.h"
#ifdef JPEG_SUPPORT
/*
@@ -76,7 +74,7 @@ int TIFFJPEGIsFullStripRequired_12(TIFF* tif);
"JPEGLib: JPEG parameter struct mismatch: library thinks size is 432,
caller expects 464"
- For such users we wil fix the problem here. See install.doc file from
+ For such users we will fix the problem here. See install.doc file from
the JPEG library distribution for details.
*/
diff --git a/src/3rdparty/libtiff/libtiff/tif_luv.c b/src/3rdparty/libtiff/libtiff/tif_luv.c
index 4b25244..aa35ea0 100644
--- a/src/3rdparty/libtiff/libtiff/tif_luv.c
+++ b/src/3rdparty/libtiff/libtiff/tif_luv.c
@@ -1,5 +1,3 @@
-/* $Id: tif_luv.c,v 1.49 2017-07-24 12:47:30 erouault Exp $ */
-
/*
* Copyright (c) 1997 Greg Ward Larson
* Copyright (c) 1997 Silicon Graphics, Inc.
@@ -215,7 +213,7 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
bp = (unsigned char*) tif->tif_rawcp;
cc = tif->tif_rawcc;
/* get each byte string */
- for (shft = 2*8; (shft -= 8) >= 0; ) {
+ for (shft = 8; shft >= 0; shft -=8) {
for (i = 0; i < npixels && cc > 0; ) {
if (*bp >= 128) { /* run */
if( cc < 2 )
@@ -349,7 +347,7 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
bp = (unsigned char*) tif->tif_rawcp;
cc = tif->tif_rawcc;
/* get each byte string */
- for (shft = 4*8; (shft -= 8) >= 0; ) {
+ for (shft = 24; shft >= 0; shft -=8) {
for (i = 0; i < npixels && cc > 0; ) {
if (*bp >= 128) { /* run */
if( cc < 2 )
@@ -467,7 +465,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
/* compress each byte string */
op = tif->tif_rawcp;
occ = tif->tif_rawdatasize - tif->tif_rawcc;
- for (shft = 2*8; (shft -= 8) >= 0; )
+ for (shft = 8; shft >= 0; shft -=8) {
for (i = 0; i < npixels; i += rc) {
if (occ < 4) {
tif->tif_rawcp = op;
@@ -522,6 +520,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
} else
rc = 0;
}
+ }
tif->tif_rawcp = op;
tif->tif_rawcc = tif->tif_rawdatasize - occ;
@@ -618,7 +617,7 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
/* compress each byte string */
op = tif->tif_rawcp;
occ = tif->tif_rawdatasize - tif->tif_rawcc;
- for (shft = 4*8; (shft -= 8) >= 0; )
+ for (shft = 24; shft >= 0; shft -=8) {
for (i = 0; i < npixels; i += rc) {
if (occ < 4) {
tif->tif_rawcp = op;
@@ -673,6 +672,7 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
} else
rc = 0;
}
+ }
tif->tif_rawcp = op;
tif->tif_rawcc = tif->tif_rawdatasize - occ;
diff --git a/src/3rdparty/libtiff/libtiff/tif_lzma.c b/src/3rdparty/libtiff/libtiff/tif_lzma.c
index 80fc394..3f6096b 100644
--- a/src/3rdparty/libtiff/libtiff/tif_lzma.c
+++ b/src/3rdparty/libtiff/libtiff/tif_lzma.c
@@ -1,5 +1,3 @@
-/* $Id: tif_lzma.c,v 1.6 2016-09-17 09:18:59 erouault Exp $ */
-
/*
* Copyright (c) 2010, Andrey Kiselev <dron@ak4719.spb.edu>
*
@@ -249,6 +247,7 @@ LZMAPreEncode(TIFF* tif, uint16 s)
{
static const char module[] = "LZMAPreEncode";
LZMAState *sp = EncoderState(tif);
+ lzma_ret ret;
(void) s;
assert(sp != NULL);
@@ -262,7 +261,13 @@ LZMAPreEncode(TIFF* tif, uint16 s)
"Liblzma cannot deal with buffers this size");
return 0;
}
- return (lzma_stream_encoder(&sp->stream, sp->filters, sp->check) == LZMA_OK);
+ ret = lzma_stream_encoder(&sp->stream, sp->filters, sp->check);
+ if (ret != LZMA_OK) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in lzma_stream_encoder(): %s", LZMAStrerror(ret));
+ return 0;
+ }
+ return 1;
}
/*
diff --git a/src/3rdparty/libtiff/libtiff/tif_lzw.c b/src/3rdparty/libtiff/libtiff/tif_lzw.c
index 186ea3c..ac685dd 100644
--- a/src/3rdparty/libtiff/libtiff/tif_lzw.c
+++ b/src/3rdparty/libtiff/libtiff/tif_lzw.c
@@ -1,5 +1,3 @@
-/* $Id: tif_lzw.c,v 1.57 2017-07-11 10:54:29 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -135,6 +133,7 @@ typedef struct {
long dec_restart; /* restart count */
#ifdef LZW_CHECKEOS
uint64 dec_bitsleft; /* available bits in raw data */
+ tmsize_t old_tif_rawcc; /* value of tif_rawcc at the end of the previous TIFLZWDecode() call */
#endif
decodeFunc dec_decode; /* regular or backwards compatible */
code_t* dec_codep; /* current recognized code */
@@ -320,6 +319,7 @@ LZWPreDecode(TIFF* tif, uint16 s)
sp->dec_nbitsmask = MAXCODE(BITS_MIN);
#ifdef LZW_CHECKEOS
sp->dec_bitsleft = 0;
+ sp->old_tif_rawcc = 0;
#endif
sp->dec_free_entp = sp->dec_codetab + CODE_FIRST;
/*
@@ -427,7 +427,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
bp = (unsigned char *)tif->tif_rawcp;
#ifdef LZW_CHECKEOS
- sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3);
+ sp->dec_bitsleft += (((uint64)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
#endif
nbits = sp->lzw_nbits;
nextdata = sp->lzw_nextdata;
@@ -555,6 +555,9 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
tif->tif_rawcp = (uint8*) bp;
+#ifdef LZW_CHECKEOS
+ sp->old_tif_rawcc = tif->tif_rawcc;
+#endif
sp->lzw_nbits = (unsigned short) nbits;
sp->lzw_nextdata = nextdata;
sp->lzw_nextbits = nextbits;
@@ -658,7 +661,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
bp = (unsigned char *)tif->tif_rawcp;
#ifdef LZW_CHECKEOS
- sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3);
+ sp->dec_bitsleft += (((uint64)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
#endif
nbits = sp->lzw_nbits;
nextdata = sp->lzw_nextdata;
@@ -776,6 +779,9 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
tif->tif_rawcp = (uint8*) bp;
+#ifdef LZW_CHECKEOS
+ sp->old_tif_rawcc = tif->tif_rawcc;
+#endif
sp->lzw_nbits = (unsigned short)nbits;
sp->lzw_nextdata = nextdata;
sp->lzw_nextbits = nextbits;
diff --git a/src/3rdparty/libtiff/libtiff/tif_next.c b/src/3rdparty/libtiff/libtiff/tif_next.c
index 0821178..0ba61ae 100644
--- a/src/3rdparty/libtiff/libtiff/tif_next.c
+++ b/src/3rdparty/libtiff/libtiff/tif_next.c
@@ -1,5 +1,3 @@
-/* $Id: tif_next.c,v 1.19 2016-09-04 21:32:56 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_ojpeg.c b/src/3rdparty/libtiff/libtiff/tif_ojpeg.c
index 92ed1fa..27385d8 100644
--- a/src/3rdparty/libtiff/libtiff/tif_ojpeg.c
+++ b/src/3rdparty/libtiff/libtiff/tif_ojpeg.c
@@ -1,5 +1,3 @@
-/* $Id: tif_ojpeg.c,v 1.69 2017-04-27 17:29: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
images. This file was was created solely in order to read unconverted images
diff --git a/src/3rdparty/libtiff/libtiff/tif_open.c b/src/3rdparty/libtiff/libtiff/tif_open.c
index a7279e1..c574c45 100644
--- a/src/3rdparty/libtiff/libtiff/tif_open.c
+++ b/src/3rdparty/libtiff/libtiff/tif_open.c
@@ -1,5 +1,3 @@
-/* $Id: tif_open.c,v 1.48 2016-11-20 22:29:47 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_packbits.c b/src/3rdparty/libtiff/libtiff/tif_packbits.c
index 18904b0..a8f29e8 100644
--- a/src/3rdparty/libtiff/libtiff/tif_packbits.c
+++ b/src/3rdparty/libtiff/libtiff/tif_packbits.c
@@ -1,5 +1,3 @@
-/* $Id: tif_packbits.c,v 1.26 2017-05-14 02:26:07 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_pixarlog.c b/src/3rdparty/libtiff/libtiff/tif_pixarlog.c
index 979858d..7438d69 100644
--- a/src/3rdparty/libtiff/libtiff/tif_pixarlog.c
+++ b/src/3rdparty/libtiff/libtiff/tif_pixarlog.c
@@ -1,5 +1,3 @@
-/* $Id: tif_pixarlog.c,v 1.54 2017-07-10 10:40:28 erouault Exp $ */
-
/*
* Copyright (c) 1996-1997 Sam Leffler
* Copyright (c) 1996 Pixar
diff --git a/src/3rdparty/libtiff/libtiff/tif_predict.c b/src/3rdparty/libtiff/libtiff/tif_predict.c
index 9ae1f57..b775663 100644
--- a/src/3rdparty/libtiff/libtiff/tif_predict.c
+++ b/src/3rdparty/libtiff/libtiff/tif_predict.c
@@ -1,5 +1,3 @@
-/* $Id: tif_predict.c,v 1.44 2017-06-18 10:31:50 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_predict.h b/src/3rdparty/libtiff/libtiff/tif_predict.h
index 6c68e21..a326b9b 100644
--- a/src/3rdparty/libtiff/libtiff/tif_predict.h
+++ b/src/3rdparty/libtiff/libtiff/tif_predict.h
@@ -1,5 +1,3 @@
-/* $Id: tif_predict.h,v 1.9 2016-10-31 17:24:26 erouault Exp $ */
-
/*
* Copyright (c) 1995-1997 Sam Leffler
* Copyright (c) 1995-1997 Silicon Graphics, Inc.
@@ -26,6 +24,10 @@
#ifndef _TIFFPREDICT_
#define _TIFFPREDICT_
+
+#include "tiffio.h"
+#include "tiffiop.h"
+
/*
* ``Library-private'' Support for the Predictor Tag
*/
diff --git a/src/3rdparty/libtiff/libtiff/tif_print.c b/src/3rdparty/libtiff/libtiff/tif_print.c
index f494cfb..1d86adb 100644
--- a/src/3rdparty/libtiff/libtiff/tif_print.c
+++ b/src/3rdparty/libtiff/libtiff/tif_print.c
@@ -1,5 +1,3 @@
-/* $Id: tif_print.c,v 1.65 2016-11-20 22:31:22 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -546,7 +544,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
uint16 i;
fprintf(fd, " %2ld: %5u",
l, td->td_transferfunction[0][l]);
- for (i = 1; i < td->td_samplesperpixel; i++)
+ for (i = 1; i < td->td_samplesperpixel - td->td_extrasamples && i < 3; i++)
fprintf(fd, " %5u",
td->td_transferfunction[i][l]);
fputc('\n', fd);
diff --git a/src/3rdparty/libtiff/libtiff/tif_read.c b/src/3rdparty/libtiff/libtiff/tif_read.c
index 2ba985a..e63810c 100644
--- a/src/3rdparty/libtiff/libtiff/tif_read.c
+++ b/src/3rdparty/libtiff/libtiff/tif_read.c
@@ -1,5 +1,3 @@
-/* $Id: tif_read.c,v 1.66 2017-11-17 20:21:00 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -58,7 +56,7 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
int is_strip, uint32 strip_or_tile,
const char* module )
{
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
tmsize_t threshold = INITIAL_THRESHOLD;
#endif
tmsize_t already_read = 0;
@@ -73,7 +71,7 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
{
tmsize_t bytes_read;
tmsize_t to_read = size - already_read;
-#if SIZEOF_VOIDP == 8 || SIZEOF_SIZE_T == 8
+#if SIZEOF_SIZE_T == 8
if( to_read >= threshold && threshold < MAX_THRESHOLD &&
already_read + to_read + rawdata_offset > tif->tif_rawdatasize )
{
@@ -348,6 +346,13 @@ TIFFSeek(TIFF* tif, uint32 row, uint16 sample )
return 0;
whole_strip = tif->tif_dir.td_stripbytecount[strip] < 10
|| isMapped(tif);
+ if( td->td_compression == COMPRESSION_LERC ||
+ td->td_compression == COMPRESSION_JBIG )
+ {
+ /* Ideally plugins should have a way to declare they don't support
+ * chunk strip */
+ whole_strip = 1;
+ }
#else
whole_strip = 1;
#endif
diff --git a/src/3rdparty/libtiff/libtiff/tif_stream.cxx b/src/3rdparty/libtiff/libtiff/tif_stream.cxx
index ecca1fd..7f640a9 100644
--- a/src/3rdparty/libtiff/libtiff/tif_stream.cxx
+++ b/src/3rdparty/libtiff/libtiff/tif_stream.cxx
@@ -1,5 +1,3 @@
-/* $Id: tif_stream.cxx,v 1.13 2015-05-28 01:50:22 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1996 Sam Leffler
* Copyright (c) 1991-1996 Silicon Graphics, Inc.
@@ -375,6 +373,9 @@ _tiffStreamOpen(const char* name, const char* mode, void *fd)
_tiffosSizeProc,
_tiffDummyMapProc,
_tiffDummyUnmapProc);
+ if (!tif) {
+ delete data;
+ }
} else {
tiffis_data *data = new tiffis_data;
data->stream = reinterpret_cast<istream *>(fd);
@@ -389,6 +390,9 @@ _tiffStreamOpen(const char* name, const char* mode, void *fd)
_tiffisSizeProc,
_tiffDummyMapProc,
_tiffDummyUnmapProc);
+ if (!tif) {
+ delete data;
+ }
}
return (tif);
diff --git a/src/3rdparty/libtiff/libtiff/tif_strip.c b/src/3rdparty/libtiff/libtiff/tif_strip.c
index 6e9f2ef..5b76fba 100644
--- a/src/3rdparty/libtiff/libtiff/tif_strip.c
+++ b/src/3rdparty/libtiff/libtiff/tif_strip.c
@@ -1,5 +1,3 @@
-/* $Id: tif_strip.c,v 1.38 2016-12-03 11:02:15 erouault Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_swab.c b/src/3rdparty/libtiff/libtiff/tif_swab.c
index 4b2e5f1..b174ba6 100644
--- a/src/3rdparty/libtiff/libtiff/tif_swab.c
+++ b/src/3rdparty/libtiff/libtiff/tif_swab.c
@@ -1,5 +1,3 @@
-/* $Id: tif_swab.c,v 1.15 2017-06-08 16:39:50 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_thunder.c b/src/3rdparty/libtiff/libtiff/tif_thunder.c
index 183199d..2388dbb 100644
--- a/src/3rdparty/libtiff/libtiff/tif_thunder.c
+++ b/src/3rdparty/libtiff/libtiff/tif_thunder.c
@@ -1,5 +1,3 @@
-/* $Id: tif_thunder.c,v 1.13 2016-09-04 21:32:56 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_tile.c b/src/3rdparty/libtiff/libtiff/tif_tile.c
index 388e168..58fe935 100644
--- a/src/3rdparty/libtiff/libtiff/tif_tile.c
+++ b/src/3rdparty/libtiff/libtiff/tif_tile.c
@@ -1,5 +1,3 @@
-/* $Id: tif_tile.c,v 1.24 2015-06-07 22:35:40 bfriesen Exp $ */
-
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_unix.c b/src/3rdparty/libtiff/libtiff/tif_unix.c
index 80c437c..874f1fe 100644
--- a/src/3rdparty/libtiff/libtiff/tif_unix.c
+++ b/src/3rdparty/libtiff/libtiff/tif_unix.c
@@ -1,5 +1,3 @@
-/* $Id: tif_unix.c,v 1.28 2017-01-11 19:02:49 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_version.c b/src/3rdparty/libtiff/libtiff/tif_version.c
index f92c843..60875bb 100644
--- a/src/3rdparty/libtiff/libtiff/tif_version.c
+++ b/src/3rdparty/libtiff/libtiff/tif_version.c
@@ -1,4 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_version.c,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */
/*
* Copyright (c) 1992-1997 Sam Leffler
* Copyright (c) 1992-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_warning.c b/src/3rdparty/libtiff/libtiff/tif_warning.c
index dc79f14..c482785 100644
--- a/src/3rdparty/libtiff/libtiff/tif_warning.c
+++ b/src/3rdparty/libtiff/libtiff/tif_warning.c
@@ -1,5 +1,3 @@
-/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_warning.c,v 1.4 2017-07-04 12:54:42 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_win32.c b/src/3rdparty/libtiff/libtiff/tif_win32.c
index 090baed..088880e 100644
--- a/src/3rdparty/libtiff/libtiff/tif_win32.c
+++ b/src/3rdparty/libtiff/libtiff/tif_win32.c
@@ -1,5 +1,3 @@
-/* $Id: tif_win32.c,v 1.42 2017-01-11 19:02:49 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -407,60 +405,21 @@ _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c)
static void
Win32WarningHandler(const char* module, const char* fmt, va_list ap)
{
-#ifndef TIF_PLATFORM_CONSOLE
- LPTSTR szTitle;
- LPTSTR szTmp;
- LPCTSTR szTitleText = "%s Warning";
- LPCTSTR szDefaultModule = "LIBTIFF";
- LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module;
- SIZE_T nBufSize = (strlen(szTmpModule) +
- strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char);
-
- if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL)
- return;
- sprintf(szTitle, szTitleText, szTmpModule);
- szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char);
- vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap);
- MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION);
- LocalFree(szTitle);
-
- return;
-#else
if (module != NULL)
fprintf(stderr, "%s: ", module);
fprintf(stderr, "Warning, ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, ".\n");
-#endif
}
TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler;
static void
Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
{
-#ifndef TIF_PLATFORM_CONSOLE
- LPTSTR szTitle;
- LPTSTR szTmp;
- LPCTSTR szTitleText = "%s Error";
- LPCTSTR szDefaultModule = "LIBTIFF";
- LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module;
- SIZE_T nBufSize = (strlen(szTmpModule) +
- strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char);
-
- if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL)
- return;
- sprintf(szTitle, szTitleText, szTmpModule);
- szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char);
- vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap);
- MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION);
- LocalFree(szTitle);
- return;
-#else
if (module != NULL)
fprintf(stderr, "%s: ", module);
vfprintf(stderr, fmt, ap);
fprintf(stderr, ".\n");
-#endif
}
TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
diff --git a/src/3rdparty/libtiff/libtiff/tif_write.c b/src/3rdparty/libtiff/libtiff/tif_write.c
index 208a2ee..a31ecd1 100644
--- a/src/3rdparty/libtiff/libtiff/tif_write.c
+++ b/src/3rdparty/libtiff/libtiff/tif_write.c
@@ -1,5 +1,3 @@
-/* $Id: tif_write.c,v 1.46 2016-12-03 21:57:44 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tif_zip.c b/src/3rdparty/libtiff/libtiff/tif_zip.c
index 42943fb..9d4bceb 100644
--- a/src/3rdparty/libtiff/libtiff/tif_zip.c
+++ b/src/3rdparty/libtiff/libtiff/tif_zip.c
@@ -1,5 +1,3 @@
-/* $Id: tif_zip.c,v 1.37 2017-05-10 15:21:16 erouault Exp $ */
-
/*
* Copyright (c) 1995-1997 Sam Leffler
* Copyright (c) 1995-1997 Silicon Graphics, Inc.
diff --git a/src/3rdparty/libtiff/libtiff/tiff.h b/src/3rdparty/libtiff/libtiff/tiff.h
index fb39634..5b0a0c9 100644
--- a/src/3rdparty/libtiff/libtiff/tiff.h
+++ b/src/3rdparty/libtiff/libtiff/tiff.h
@@ -1,5 +1,3 @@
-/* $Id: tiff.h,v 1.70 2016-01-23 21:20:34 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -189,7 +187,11 @@ typedef enum {
#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */
#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */
#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */
+#define COMPRESSION_LERC 34887 /* ESRI Lerc codec: https://github.com/Esri/lerc */
+/* compression codes 34887-34889 are reserved for ESRI */
#define COMPRESSION_LZMA 34925 /* LZMA2 */
+#define COMPRESSION_ZSTD 50000 /* ZSTD: WARNING not registered in Adobe-maintained registry */
+#define COMPRESSION_WEBP 50001 /* WEBP: WARNING not registered in Adobe-maintained registry */
#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */
#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */
#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */
@@ -450,6 +452,8 @@ typedef enum {
/* tag 34929 is a private tag registered to FedEx */
#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */
#define TIFFTAG_INTEROPERABILITYIFD 40965 /* Pointer to Interoperability private directory */
+/* tags 50674 to 50677 are reserved for ESRI */
+#define TIFFTAG_LERC_PARAMETERS 50674 /* Stores LERC version and additional compression method */
/* Adobe Digital Negative (DNG) format tags */
#define TIFFTAG_DNGVERSION 50706 /* &DNG version number */
#define TIFFTAG_DNGBACKWARDVERSION 50707 /* &DNG compatibility version */
@@ -603,6 +607,16 @@ typedef enum {
#define TIFFTAG_PERSAMPLE 65563 /* interface for per sample tags */
#define PERSAMPLE_MERGED 0 /* present as a single value */
#define PERSAMPLE_MULTI 1 /* present as multiple values */
+#define TIFFTAG_ZSTD_LEVEL 65564 /* ZSTD compression level */
+#define TIFFTAG_LERC_VERSION 65565 /* LERC version */
+#define LERC_VERSION_2_4 4
+#define TIFFTAG_LERC_ADD_COMPRESSION 65566 /* LERC additional compression */
+#define LERC_ADD_COMPRESSION_NONE 0
+#define LERC_ADD_COMPRESSION_DEFLATE 1
+#define LERC_ADD_COMPRESSION_ZSTD 2
+#define TIFFTAG_LERC_MAXZERROR 65567 /* LERC maximum error */
+#define TIFFTAG_WEBP_LEVEL 65568 /* WebP compression level: WARNING not registered in Adobe-maintained registry */
+#define TIFFTAG_WEBP_LOSSLESS 65569 /* WebP lossless/lossy : WARNING not registered in Adobe-maintained registry */
/*
* EXIF tags
diff --git a/src/3rdparty/libtiff/libtiff/tiffconf.h.in b/src/3rdparty/libtiff/libtiff/tiffconf.h.in
index 6da9c5a..5de30c9 100644
--- a/src/3rdparty/libtiff/libtiff/tiffconf.h.in
+++ b/src/3rdparty/libtiff/libtiff/tiffconf.h.in
@@ -37,15 +37,6 @@
/* Pointer difference type */
#undef TIFF_PTRDIFF_T
-/* Define to 1 if the system has the type `int16'. */
-#undef HAVE_INT16
-
-/* Define to 1 if the system has the type `int32'. */
-#undef HAVE_INT32
-
-/* Define to 1 if the system has the type `int8'. */
-#undef HAVE_INT8
-
/* Compatibility stuff. */
/* Define as 0 or 1 according to the floating point format suported by the
diff --git a/src/3rdparty/libtiff/libtiff/tiffconf.vc.h b/src/3rdparty/libtiff/libtiff/tiffconf.vc.h
index c8c6c65..fb37a75 100644
--- a/src/3rdparty/libtiff/libtiff/tiffconf.vc.h
+++ b/src/3rdparty/libtiff/libtiff/tiffconf.vc.h
@@ -7,15 +7,6 @@
#ifndef _TIFFCONF_
#define _TIFFCONF_
-/* Define to 1 if the system has the type `int16'. */
-/* #undef HAVE_INT16 */
-
-/* Define to 1 if the system has the type `int32'. */
-/* #undef HAVE_INT32 */
-
-/* Define to 1 if the system has the type `int8'. */
-/* #undef HAVE_INT8 */
-
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
diff --git a/src/3rdparty/libtiff/libtiff/tiffconf.wince.h b/src/3rdparty/libtiff/libtiff/tiffconf.wince.h
index 2ef3958..013b096 100644
--- a/src/3rdparty/libtiff/libtiff/tiffconf.wince.h
+++ b/src/3rdparty/libtiff/libtiff/tiffconf.wince.h
@@ -1,5 +1,3 @@
-/* $Id: tiffconf.wince.h,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */
-
/*
* Windows CE platform tiffconf.wince.h
* Created by Mateusz Loskot (mateusz@loskot.net)
@@ -27,15 +25,6 @@
#ifndef _TIFFCONF_
#define _TIFFCONF_
-/* Define to 1 if the system has the type `int16'. */
-/* #undef HAVE_INT16 */
-
-/* Define to 1 if the system has the type `int32'. */
-/* #undef HAVE_INT32 */
-
-/* Define to 1 if the system has the type `int8'. */
-/* #undef HAVE_INT8 */
-
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
diff --git a/src/3rdparty/libtiff/libtiff/tiffio.h b/src/3rdparty/libtiff/libtiff/tiffio.h
index ef61b5c..31c2e67 100644
--- a/src/3rdparty/libtiff/libtiff/tiffio.h
+++ b/src/3rdparty/libtiff/libtiff/tiffio.h
@@ -1,5 +1,3 @@
-/* $Id: tiffio.h,v 1.94 2017-01-11 19:02:49 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -52,7 +50,7 @@ typedef struct tiff TIFF;
* promoted type (i.e. one of int, unsigned int, pointer,
* or double) and because we defined pseudo-tags that are
* outside the range of legal Aldus-assigned tags.
- * NB: tsize_t is int32 and not uint32 because some functions
+ * NB: tsize_t is signed and not unsigned because some functions
* return -1.
* NB: toff_t is not off_t for many reasons; TIFFs max out at
* 32-bit file offsets, and BigTIFF maxes out at 64-bit
diff --git a/src/3rdparty/libtiff/libtiff/tiffio.hxx b/src/3rdparty/libtiff/libtiff/tiffio.hxx
index ed994f1..df2cbbc 100644
--- a/src/3rdparty/libtiff/libtiff/tiffio.hxx
+++ b/src/3rdparty/libtiff/libtiff/tiffio.hxx
@@ -1,5 +1,3 @@
-/* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -33,6 +31,7 @@
#include <iostream>
#include "tiff.h"
+#include "tiffio.h"
extern TIFF* TIFFStreamOpen(const char*, std::ostream *);
extern TIFF* TIFFStreamOpen(const char*, std::istream *);
diff --git a/src/3rdparty/libtiff/libtiff/tiffiop.h b/src/3rdparty/libtiff/libtiff/tiffiop.h
index daa291c..186c291 100644
--- a/src/3rdparty/libtiff/libtiff/tiffiop.h
+++ b/src/3rdparty/libtiff/libtiff/tiffiop.h
@@ -1,5 +1,3 @@
-/* $Id: tiffiop.h,v 1.95 2017-09-07 14:02:52 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -72,6 +70,7 @@ extern int snprintf(char* str, size_t size, const char* format, ...);
#endif
#define streq(a,b) (strcmp(a,b) == 0)
+#define strneq(a,b,n) (strncmp(a,b,n) == 0)
#ifndef TRUE
#define TRUE 1
@@ -314,11 +313,15 @@ typedef size_t TIFFIOSize_t;
#define _TIFF_off_t off_t
#endif
-#if __clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 8)
+#if defined(__has_attribute) && defined(__clang__)
+#if __has_attribute(no_sanitize)
#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW __attribute__((no_sanitize("unsigned-integer-overflow")))
#else
#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
#endif
+#else
+#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
+#endif
#if defined(__cplusplus)
@@ -424,6 +427,12 @@ extern int TIFFInitSGILog(TIFF*, int);
#ifdef LZMA_SUPPORT
extern int TIFFInitLZMA(TIFF*, int);
#endif
+#ifdef ZSTD_SUPPORT
+extern int TIFFInitZSTD(TIFF*, int);
+#endif
+#ifdef WEBP_SUPPORT
+extern int TIFFInitWebP(TIFF*, int);
+#endif
#ifdef VMS
extern const TIFFCodec _TIFFBuiltinCODECS[];
#else
diff --git a/src/3rdparty/libtiff/libtiff/tiffvers.h b/src/3rdparty/libtiff/libtiff/tiffvers.h
index 7c41574..403d61b 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.9\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
+#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.10\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 20171118
+#define TIFFLIB_VERSION 20181110
diff --git a/src/3rdparty/libtiff/port/dummy.c b/src/3rdparty/libtiff/port/dummy.c
index 923ee7b..346a07e 100644
--- a/src/3rdparty/libtiff/port/dummy.c
+++ b/src/3rdparty/libtiff/port/dummy.c
@@ -1,5 +1,3 @@
-/* $Id: dummy.c,v 1.3 2007-03-21 14:54:16 dron Exp $ */
-
/*
* Dummy function, just to be ensure that the library always will be created.
*/
diff --git a/src/3rdparty/libtiff/port/getopt.c b/src/3rdparty/libtiff/port/getopt.c
index 6eff8ee..c7bdb11 100644
--- a/src/3rdparty/libtiff/port/getopt.c
+++ b/src/3rdparty/libtiff/port/getopt.c
@@ -1,5 +1,3 @@
-/* $Id: getopt.c,v 1.3 2009-01-22 20:53:07 fwarmerdam Exp $ */
-
/*
* Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved.
diff --git a/src/3rdparty/libtiff/port/lfind.c b/src/3rdparty/libtiff/port/lfind.c
index 22d9798..00ab649 100644
--- a/src/3rdparty/libtiff/port/lfind.c
+++ b/src/3rdparty/libtiff/port/lfind.c
@@ -1,5 +1,3 @@
-/* $Id: lfind.c,v 1.4 2007-01-15 18:40:39 mloskot Exp $ */
-
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/src/3rdparty/libtiff/port/libport.h b/src/3rdparty/libtiff/port/libport.h
index d9b0421..ff26263 100644
--- a/src/3rdparty/libtiff/port/libport.h
+++ b/src/3rdparty/libtiff/port/libport.h
@@ -1,5 +1,3 @@
-/* $Id: libport.h,v 1.5 2015-08-19 02:31:04 bfriesen Exp $ */
-
/*
* Copyright (c) 2009 Frank Warmerdam
*
@@ -38,9 +36,18 @@ int strcasecmp(const char *s1, const char *s2);
# define HAVE_GETOPT 1
#endif
-#if 0
+#if HAVE_STRTOL
+long strtol(const char *nptr, char **endptr, int base);
+#endif
+#if HAVE_STRTOLL
+long long strtoll(const char *nptr, char **endptr, int base);
+#endif
+#if HAVE_STRTOUL
unsigned long strtoul(const char *nptr, char **endptr, int base);
#endif
+#if HAVE_STRTOULL
+unsigned long long strtoull(const char *nptr, char **endptr, int base);
+#endif
#if 0
void *
diff --git a/src/3rdparty/libtiff/port/strcasecmp.c b/src/3rdparty/libtiff/port/strcasecmp.c
index de7e423..65e2b41 100644
--- a/src/3rdparty/libtiff/port/strcasecmp.c
+++ b/src/3rdparty/libtiff/port/strcasecmp.c
@@ -1,5 +1,3 @@
-/* $Id: strcasecmp.c,v 1.4 2015-06-21 01:09:09 bfriesen Exp $ */
-
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/src/3rdparty/libtiff/port/strtoul.c b/src/3rdparty/libtiff/port/strtoul.c
index 84ab215..dbd44f1 100644
--- a/src/3rdparty/libtiff/port/strtoul.c
+++ b/src/3rdparty/libtiff/port/strtoul.c
@@ -1,8 +1,9 @@
-/* $Id: strtoul.c,v 1.2 2005-07-07 16:34:06 dron Exp $ */
+/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */
-/*
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
+/*-
+ * Copyright (c) 2005 The DragonFly Project. All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -12,14 +13,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -30,80 +28,17 @@
*/
#if 0
-static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
-__RCSID("$NetBSD: strtoul.c,v 1.16 2003/08/07 16:43:45 agc Exp $");
+__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $");
#endif
+#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
-/*
- * Convert a string to an unsigned long integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-unsigned long
-strtoul(const char *nptr, char **endptr, int base)
-{
- const char *s;
- unsigned long acc, cutoff;
- int c;
- int neg, any, cutlim;
-
- /*
- * See strtol for comments as to the logic used.
- */
- s = nptr;
- do {
- c = (unsigned char) *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
+#define _FUNCNAME strtoul
+#define __UINT unsigned long int
+#define __UINT_MAX ULONG_MAX
- cutoff = ULONG_MAX / (unsigned long)base;
- cutlim = (int)(ULONG_MAX % (unsigned long)base);
- for (acc = 0, any = 0;; c = (unsigned char) *s++) {
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0)
- continue;
- if (acc > cutoff || (acc == cutoff && c > cutlim)) {
- any = -1;
- acc = ULONG_MAX;
- errno = ERANGE;
- } else {
- any = 1;
- acc *= (unsigned long)base;
- acc += c;
- }
- }
- if (neg && any > 0)
- acc = -acc;
- if (endptr != 0)
- /* LINTED interface specification */
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
+#include "_strtoul.h"
diff --git a/src/3rdparty/libtiff/port/strtoull.c b/src/3rdparty/libtiff/port/strtoull.c
index c37ee16..91e4ddf 100644
--- a/src/3rdparty/libtiff/port/strtoull.c
+++ b/src/3rdparty/libtiff/port/strtoull.c
@@ -1,11 +1,9 @@
+/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */
+
/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Copyright (c) 2011 The FreeBSD Foundation
+ * Copyright (c) 2005 The DragonFly Project. All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
* All rights reserved.
- * Portions of this software were developed by David Chisnall
- * under sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -15,14 +13,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -32,86 +27,18 @@
* SUCH DAMAGE.
*/
-#include <limits.h>
-#include <errno.h>
+#if 0
+__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $");
+#endif
+
+#include <assert.h>
#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
#include <stdlib.h>
-/*
- * Convert a string to an unsigned long long integer.
- *
- * Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-unsigned long long
-strtoull(const char *nptr, char **endptr, int base)
-{
- const char *s;
- unsigned long long acc;
- char c;
- unsigned long long cutoff;
- int neg, any, cutlim;
-
- /*
- * See strtoq for comments as to the logic used.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace((unsigned char)c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X') &&
- ((s[1] >= '0' && s[1] <= '9') ||
- (s[1] >= 'A' && s[1] <= 'F') ||
- (s[1] >= 'a' && s[1] <= 'f'))) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
- acc = any = 0;
- if (base < 2 || base > 36)
- goto noconv;
+#define _FUNCNAME strtoull
+#define __UINT unsigned long long int
+#define __UINT_MAX ULLONG_MAX
- cutoff = ULLONG_MAX / base;
- cutlim = ULLONG_MAX % base;
- for ( ; ; c = *s++) {
- if (c >= '0' && c <= '9')
- c -= '0';
- else if (c >= 'A' && c <= 'Z')
- c -= 'A' - 10;
- else if (c >= 'a' && c <= 'z')
- c -= 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= base;
- acc += c;
- }
- }
- if (any < 0) {
- acc = ULLONG_MAX;
- errno = ERANGE;
- } else if (!any) {
-noconv:
- errno = EINVAL;
- } else if (neg)
- acc = -acc;
- if (endptr != NULL)
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
+#include "_strtoul.h"
diff --git a/src/3rdparty/libtiff/qt_attribution.json b/src/3rdparty/libtiff/qt_attribution.json
index c247ea2..e4f2db3 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.9",
+ "Version": "4.0.10",
"License": "libtiff License",
"LicenseId": "libtiff",
"LicenseFile": "COPYRIGHT",