Commit Graph

3511 Commits

Author SHA1 Message Date
skal
ce70d17ee6 Fix potential overflow in gtStripContig()
(w + w) might not fit in int32 if too large.
2020-11-12 15:41:14 +00:00
Even Rouault
2e822691d7
TIFFStartStrip(): avoid potential crash in WebP codec when using scanline access on corrupted files. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26650 2020-10-26 11:32:42 +01:00
Even Rouault
b0469e8157
tif_webp.c: validate tile/strip dimension to avoid unsigned integer overflow in RGBA.size computation 2020-10-20 13:47:16 +02:00
Even Rouault
8aec9c8d29
tif_zip.c: fix typo in comment 2020-10-19 14:25:40 +02:00
Even Rouault
3550db1ad2
tiff.h: remove irrelevant warning about webp related pseudo-tags not being registered: they are purely internal libtiff concepts 2020-10-16 15:23:56 +02:00
Even Rouault
0047ca708b Merge branch 'libdeflate' into 'master'
Add support for building against libdeflate for faster Zip/Deflate compression/decompression

See merge request libtiff/libtiff!158
2020-10-16 13:22:06 +00:00
Even Rouault
b9fa1f6e4a
test: add testdeflatelaststripextradata.sh 2020-10-16 13:40:11 +02:00
Even Rouault
3a2de853a9
Add support for optional building against libdeflate for faster Zip/Deflate compression/decompression.
So we can have 2 kind of builds with the Zip/Deflate codec:
- zlib only
- zlib + libdeflate

Speed improvements in the 35%-50% range can be expected when libdeflate is used.
Compression level up to 12 is now supported (capped to 9 when zlib is used).
Still requires zlib for situations where libdeflate cannot be used (that
is for scanline access, since libdeflate has no streaming mode)

Pseudo-tag TIFFTAG_DEFLATE_SUBCODEC=DEFLATE_SUBCODEC_ZLIB/DEFLATE_SUBCODEC_LIBDEFLATE
is added to control which subcodec (zlib or libdeflate) should be used (it defaults
of course to libdeflate, when it is available).
This is mostly aimed at being used on the writing side, to be able to reproduce
output of previous libtiff versions at a binary level, in situations where this would
be really needed. Or as a safety belt in case there would be unforeseen issues
with using libdeflate.
It can be used to know when libdeflate is available at runtime (DEFLATE_SUBCODEC_LIBDEFLATE
will be the default value in that situation).

Of course, deflate codestreams produced by libdeflate can be read by zlib, and vice-versa.
2020-10-16 13:40:10 +02:00
Even Rouault
ac64d74bdf
tif_webp.c: fix compiler warnings with MSVC 2020-10-14 14:39:50 +02:00
Even Rouault
e2801db6fd Merge branch 'various_fixes' into 'master'
Fix compiler warnings about unused variables when assert() expands to nothing

See merge request libtiff/libtiff!157
2020-10-12 19:18:40 +00:00
Even Rouault
4c4965a9df
.gitignore: add entries for new files in test/ 2020-10-12 20:20:38 +02:00
Even Rouault
c4aa76401b
Fix compiler warnings about unused variables when assert() expands to nothing 2020-10-12 19:45:51 +02:00
Roger Leigh
3279b00500 Merge branch '215-cygwin-appveyor-fail' into 'master'
Update Appveyor CI build to build with VS2019 image

Closes #215

See merge request libtiff/libtiff!154
2020-10-09 18:05:25 +00:00
Roger Leigh
7f8f6991da wip 2020-10-09 18:10:56 +01:00
Roger Leigh
42b6225641 wip 2020-10-09 17:58:44 +01:00
Roger Leigh
aeddabed84 wip 2020-10-09 17:00:46 +01:00
Roger Leigh
7d8b5e3695 wip 2020-10-09 16:47:38 +01:00
Roger Leigh
9911889a25 wip 2020-10-09 16:19:58 +01:00
Roger Leigh
4d1e1bc362 wip 2020-10-09 15:49:47 +01:00
Roger Leigh
e61c593494 Merge branch 'TIFF-217_m_lib_path' into 'master'
cmake: Do not use absolute libm path

Closes #217

See merge request libtiff/libtiff!156
2020-10-09 09:21:55 +00:00
Roger Leigh
7c9ca61785 cmake: Do not use absolute libm path 2020-10-09 08:32:44 +01:00
Even Rouault
a4cae3b8a3
tif_fax3.h: restore systematic calls to CLEANUP_RUNS()
now that SETVALUE() no longer cause overflows.
Those were removed per b351db8be1 and
3440ac2164.

As SETVALUE() now returns an error, this allow the decoder to exit.

Otherwise, the assert(x == lastx) in _TIFFFax3fillruns() can trigger.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26201
2020-10-08 12:20:52 +02:00
Even Rouault
4ee4a69bbb Merge branch 'check_TIFFFlushData1' into 'master'
FAX/JPEG/LZMA/PixarLog/ZIP/ZSTD codecs: make sure to check TIFFFlushData1() return value

See merge request libtiff/libtiff!155
2020-10-06 09:57:51 +00:00
Even Rouault
8c4c297a48 Merge branch 'shared-memory' into 'master'
Set the --shared-memory linker flag for Emscripten builds

See merge request libtiff/libtiff!153
2020-10-04 09:51:13 +00:00
Even Rouault
ca70b5e702
tiff2rgba.c: fix -Wold-style-declaration warning 2020-10-03 18:16:27 +02:00
Even Rouault
ff1022ac06
FAX/JPEG/LZMA/PixarLog/ZIP/ZSTD codecs: make sure to check TIFFFlushData1() return value 2020-10-03 18:12:04 +02:00
Even Rouault
9febb7599a
tif_fax3.h: extra buffer overflow checks. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25934 2020-09-26 23:02:19 +02:00
Roger Leigh
6d078fe1f8 wip 2020-09-25 17:14:58 +01:00
Roger Leigh
e8863893b0 wip 2020-09-25 10:47:23 +01:00
Roger Leigh
5123e29287 wip 2020-09-25 10:12:02 +01:00
Roger Leigh
3b522bf470 wip 2020-09-25 09:57:15 +01:00
Roger Leigh
5d0476eb0b wip 2020-09-25 09:43:43 +01:00
Roger Leigh
9555de026e wip 2020-09-25 09:33:47 +01:00
Roger Leigh
04b299927f Update AppVeyor image 2020-09-25 09:10:07 +01:00
Roger Leigh
f846cd6452 test-appveyor 2020-09-25 09:01:47 +01:00
Attila Oláh
2b9abce31b
Also pass --shared-memory to raw_decode.
This is needed when building for Emscripten with *both* WEBP and JPEG
support.
2020-09-24 17:24:12 +00:00
Attila Oláh
433e052356
Set the --shared-memory linker flag for Emscripten builds.
This is only needed when building with WEBP support, which uses atomics,
therefore the linker needs the --shared-memory flag. The flag cannot be
added globally because not all executables link against libwebp.
2020-09-24 16:22:25 +00:00
Even Rouault
c8f0a16f4a
tif_fax3.h: return error when a buffer overflow occurs. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25552 and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25849 2020-09-22 18:27:44 +02:00
Even Rouault
57d487aa1c Merge branch 'fix-float-compare' into 'master'
Fix comparison for max negative float value.

See merge request libtiff/libtiff!152
2020-09-11 09:41:47 +00:00
Dirk Lemstra
c0e310bc3f
Fix comparison for max negative float value. 2020-09-11 10:41:11 +02:00
Even Rouault
7b840002c1
Fax3PreDecode(): reset curruns and refruns state variables
to avoid out-of-bounds write triggered by GDAL when repeatedly
reading a corrupt strip.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25493
2020-09-07 23:51:23 +02:00
Thomas Bernard
1373f8dacb Merge branch 'issue-17' into 'master'
normalize tools behaviour regarding -h

Closes #17

See merge request libtiff/libtiff!115
2020-06-06 20:32:09 +00:00
Even Rouault
8a58319106
TWebPSetupEncode(): fix logic problem (and instead of or) in test that checks input is 8bit unsigned data 2020-05-31 21:18:21 +02:00
Even Rouault
6b3b189d5b
TIFFGetConfiguredCODECs(): fix to avoid wrong structure to be returned for registered (ie non built-in) codecs 2020-05-13 00:56:14 +02:00
Even Rouault
2a597b76cc Merge branch 'zstd-webp-update' into 'master'
gitlab-ci: use latest zstd and webp versions

See merge request libtiff/libtiff!148
2020-05-09 12:15:38 +00:00
Even Rouault
4c750d0238 Merge branch 'deprecated' into 'master'
ojpeg: s/Depreciated/Deprecated/

See merge request libtiff/libtiff!149
2020-05-09 12:13:27 +00:00
Aaron Boxer
0c2445854f ojpeg: s/Depreciated/Deprecated/ 2020-05-09 08:00:43 -04:00
Even Rouault
5fb3593eba
Fix typos 2020-04-28 00:49:54 +02:00
Even Rouault
8405704ebb
tif_jpeg.c: avoid potential division in previous fix (master only) 2020-04-27 13:20:55 +02:00
Thomas Bernard
312105b4a1
gitlab-ci: use latest zstd and webp versions 2020-04-26 22:32:35 +02:00