Commit Graph

3097 Commits

Author SHA1 Message Date
Ben Boeckel
fc3b735300 cmake: use check_symbol_exists
This accounts for symbols being provided by macros.
2018-01-15 11:27:34 -05:00
Ben Boeckel
f5b23ab1bf cmake: remove unused configure checks 2018-01-15 11:27:34 -05:00
Kevin Funk
0b05f43209 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-12 12:17:13 +01:00
Ben Boeckel
647b0e8c11 tiffiop: use __has_attribute to detect the no_sanitize attribute 2018-01-09 15:09:02 -05:00
Even Rouault
1dcf5303e1 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 2017-12-31 15:42:52 +01:00
Even Rouault
8d4d8b5c2f 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 2017-12-31 15:30:44 +01:00
Even Rouault
c6f41df7b5 libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer dereference on corrupted file. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2770 2017-12-31 15:09:41 +01:00
Even Rouault
25c14f84a8 Add libzstd to gitlab-ci 2017-12-21 14:52:30 +01:00
Even Rouault
62b9df5d2a 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-21 13:32:02 +01:00
Even Rouault
5848777bd7 Merge branch 'fix_cve-2017-9935' into 'master'
Fix CVE-2017-9935

See merge request libtiff/libtiff!7
2017-12-10 21:00:44 +00:00
Brian May
d4f213636b 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-11 07:35:41 +11:00
Brian May
3dd8f6a357 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-11 07:35:18 +11:00
Even Rouault
254262f395 Merge branch 'undef-warn-fixes' into 'master'
Fix a couple of harmless but annoying -Wundef warnings

See merge request libtiff/libtiff!8
2017-12-10 18:09:50 +00:00
Vadim Zeitlin
7293a4165b 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.
2017-12-08 03:33:33 +01:00
Vadim Zeitlin
1eb6fefb2e Avoid harmless -Wundef warnings for __clang_major__
Check that we're using Clang before checking its version.
2017-12-08 03:33:31 +01:00
Even Rouault
9c243a11a3 Merge branch 'remove_autogenerated_files' into 'master'
Remove autogenerated files

See merge request libtiff/libtiff!5
2017-12-02 22:10:48 +00:00
Bob Friesenhahn
0a5f4b92bb 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 21:12:15 +00:00
Bob Friesenhahn
79bb4d034f 'tif_config.h' or 'tiffio.h' must be included before any system header. 2017-12-02 14:45:03 -06:00
Even Rouault
64541f2893 .gitignore: add patterns for build from root 2017-12-01 16:00:49 +01:00
Even Rouault
c56eda4b7e Remove remaining .cvsignore files 2017-12-01 15:55:10 +01:00
Even Rouault
2440a113ea Remove autoconf/automake generated files, and add them to .gitignore 2017-12-01 15:54:48 +01:00
Olivier Paquet
e000ac8aa5 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 14:16:01 +00:00
Even Rouault
b02973f1bf 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 11:48:17 +01:00
Even Rouault
311335ea46 Merge branch 'git_updates' into 'master'
CVS to Git updates

See merge request libtiff/libtiff!2
2017-12-01 10:02:10 +00:00
Even Rouault
95665760ef HOWTO-RELEASE: update to use signed tags 2017-12-01 10:58:09 +01:00
Even Rouault
f756566000 README.md: use markdown syntax for hyperlinks 2017-12-01 10:52:18 +01:00
Even Rouault
b48399eabe Add .gitignore 2017-11-30 18:23:40 +01:00
Even Rouault
8603db6cfa Regenerate autoconf files 2017-11-30 18:10:01 +01:00
Even Rouault
40c6649483 Makefile.am: update to reflect removal of README.vms and README -> README.md 2017-11-30 18:09:43 +01:00
Even Rouault
f0a54a4fa0 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
Even Rouault
5cc89a8c8d HOWTO-RELEASE: update for git 2017-11-30 17:46:53 +01:00
Even Rouault
22c0c1ec70 Remove outdated .cvsignore 2017-11-30 17:45:40 +01:00
Even Rouault
5c661fa019 Remove outdated commit script 2017-11-30 17:45:20 +01:00
Even Rouault
be7c2b687b Remove README.vms 2017-11-30 17:44:53 +01:00
Even Rouault
0769c447b7 Rename README as README.md, and update content 2017-11-30 17:44:47 +01:00
Even Rouault
b1374e94ac html/index.html: reflect change from CVS to gitlab 2017-11-30 16:55:01 +01:00
Olivier Paquet
92d54fd77a Merge branch 'test-ci' into 'master'
Update CI configuration

See merge request libtiff/libtiff!1
2017-11-30 14:04:12 +00:00
Roger Leigh
68c928923a appveyor: Correct path for git clone and skip artefact archival 2017-11-23 08:23:34 +00:00
Roger Leigh
4f84ea631b travis-ci: Remove unused matrix exclusion 2017-11-22 22:58:32 +00:00
Roger Leigh
1ac42d5f93 Add gitlab-ci build support 2017-11-22 22:57:48 +00:00
Bob Friesenhahn
38ec4dd074 Change default user id in HOWTO-RELEASE to mine. 2017-11-18 20:04:50 +00:00
Bob Friesenhahn
020bd2fd3b * configure.ac: libtiff 4.0.9 released. 2017-11-18 20:00:43 +00:00
Bob Friesenhahn
737c52ae13 * html/v4.0.9.html: Add HTML file to document changes in libtiff
v4.0.9.
2017-11-18 19:38:06 +00:00
Even Rouault
5426f499e8 * libtiff/tif_aux.c, tif_getimage.c, tif_read.c: typo fixes in
comments.
2017-11-17 20:20:59 +00:00
Bob Friesenhahn
238b103ba5 List Frank Warmerdam and Andrey Kiselev as past maintainers since they have not been active in years. 2017-11-07 02:00:06 +00:00
Bob Friesenhahn
45065882ae * test/Makefile.am: Add some tests for tiff2bw. 2017-11-02 13:51:22 +00:00
Bob Friesenhahn
25f9ffa565 * tools/tiff2bw.c (main): Free memory allocated in the tiff2bw
program.  This is in response to the report associated with
CVE-2017-16232 but does not solve the extremely high memory usage
with the associated POC file.
2017-11-01 13:41:58 +00:00
Bob Friesenhahn
61d4eb3a01 tiff2pdf.c: Fix possible overflow in bounds check computation and eliminate signed/unsigned comparison. 2017-10-29 18:50:41 +00:00
Bob Friesenhahn
1cb6c46b9d fax2tiff: Pass the FAX_Client_Data struct as client data 2017-10-29 18:28:43 +00:00
Even Rouault
f258b80230 * libtiff/tif_getimage.c: avoid floating point division by zero in
initCIELabConversion()
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3733
Credit to OSS Fuzz
2017-10-23 11:34:26 +00:00