openjpeg.git
2 years agocmake: add install interface include directory 1370/head
Anonymous Maarten [Sun, 1 Aug 2021 18:56:40 +0000 (20:56 +0200)]
cmake: add install interface include directory

2 years agoFix segfault in src/bin/jp2/opj_decompress.c due to uninitialized pointer (fixes...
xiaoxiaoafeifei [Wed, 14 Jul 2021 01:35:13 +0000 (09:35 +0800)]
Fix segfault in src/bin/jp2/opj_decompress.c due to uninitialized pointer (fixes #1368) (#1369)

2 years agoFix code formatting
Even Rouault [Mon, 12 Jul 2021 13:59:41 +0000 (15:59 +0200)]
Fix code formatting

2 years agoMerge pull request #1366 from sebras/fix-out-of-bounds-access
Even Rouault [Mon, 12 Jul 2021 13:58:06 +0000 (15:58 +0200)]
Merge pull request #1366 from sebras/fix-out-of-bounds-access

opj_j2k_is_imf_compliant: Fix out of bounds access

2 years agoopj_j2k_is_imf_compliant: Fix out of bounds access. 1366/head
Sebastian Rasmussen [Mon, 12 Jul 2021 13:31:28 +0000 (15:31 +0200)]
opj_j2k_is_imf_compliant: Fix out of bounds access.

Previously when mainlevel was parsed == 12 openjpeg would generate
a warning, but then the sublevel value would be compared to an out
of bounds element in the tabMaxSubLevelFromMainLevel array. From
this commit OpenJPEG will only use mainlevel if in range.

2 years agoMerge pull request #1365 from sebras/fix-warning-formatting
Even Rouault [Mon, 12 Jul 2021 10:02:12 +0000 (12:02 +0200)]
Merge pull request #1365 from sebras/fix-warning-formatting

opj_j2k_is_imf_compliant: Fix argument formatting for warnings.

2 years agoopj_j2k_is_imf_compliant: Fix argument formatting for warnings. 1365/head
Sebastian Rasmussen [Mon, 12 Jul 2021 01:04:55 +0000 (03:04 +0200)]
opj_j2k_is_imf_compliant: Fix argument formatting for warnings.

2 years agoMerge pull request #1361 from rouault/update_version_numbers_to_2_5
Even Rouault [Wed, 9 Jun 2021 09:53:56 +0000 (11:53 +0200)]
Merge pull request #1361 from rouault/update_version_numbers_to_2_5

CMakeLists.txt/appveyor.yml: update version number to 2.5.0…

2 years agoCMakeLists.txt/appveyor.yml: update version number to 2.5.0 to make it easier for... 1361/head
Even Rouault [Tue, 8 Jun 2021 12:34:43 +0000 (14:34 +0200)]
CMakeLists.txt/appveyor.yml: update version number to 2.5.0 to make it easier for downstream consumers to use new features

2 years agoMerge pull request #1359 from rouault/TLM
Even Rouault [Tue, 8 Jun 2021 09:11:04 +0000 (11:11 +0200)]
Merge pull request #1359 from rouault/TLM

Add support for enabling generation of TLM markers in encoder

2 years agoAdd support for enabling generation of TLM markers in encoder 1359/head
Even Rouault [Mon, 7 Jun 2021 13:16:53 +0000 (15:16 +0200)]
Add support for enabling generation of TLM markers in encoder

Support was already there, but restricted to Cinema and IMF profiles,
and 255 tiles

* Add -TLM switch added to opj_compress
* Make opj_encoder_set_extra_options() function accept a TLM=YES option.

2 years agoMerge pull request #1360 from rouault/travis_gcc_4_8_fix
Even Rouault [Mon, 7 Jun 2021 13:48:42 +0000 (15:48 +0200)]
Merge pull request #1360 from rouault/travis_gcc_4_8_fix

.travis.yml: try to fix gcc 4.8 config by updating to xenial

2 years ago.travis.yml: try to fix gcc 4.8 config by updating to xenial 1360/head
Even Rouault [Mon, 7 Jun 2021 13:41:39 +0000 (15:41 +0200)]
.travis.yml: try to fix gcc 4.8 config by updating to xenial

2 years agoMerge pull request #1358 from rouault/compiler_warning_fixes
Even Rouault [Mon, 7 Jun 2021 11:56:11 +0000 (13:56 +0200)]
Merge pull request #1358 from rouault/compiler_warning_fixes

Fix various compiler warnings

2 years agoFix various compiler warnings 1358/head
Even Rouault [Mon, 7 Jun 2021 11:28:26 +0000 (13:28 +0200)]
Fix various compiler warnings

2 years agoopenjpeg.c: avoid casts of function pointers
Even Rouault [Mon, 7 Jun 2021 10:57:30 +0000 (12:57 +0200)]
openjpeg.c: avoid casts of function pointers

2 years agoMerge pull request #1354 from msabwat/emscripten
Even Rouault [Tue, 1 Jun 2021 20:59:11 +0000 (22:59 +0200)]
Merge pull request #1354 from msabwat/emscripten

fix #1345: don't remove big endian test for other platforms

2 years agofix #1345: don't remove big endian test for other platforms 1354/head
Mehdi Sabwat [Tue, 1 Jun 2021 20:39:27 +0000 (22:39 +0200)]
fix #1345: don't remove big endian test for other platforms

thanks to @ePirat, it turns out that !EMSCRIPTEN does not evaluate to 1 on other platforms, so the the #1345 actually disabled the test for all platforms.

3 years agoMerge pull request #1345 from msabwat/emscripten
Even Rouault [Fri, 7 May 2021 09:22:13 +0000 (11:22 +0200)]
Merge pull request #1345 from msabwat/emscripten

emscripten: disable big endian test

3 years agoemscripten: disable big endian test 1345/head
Mehdi Sabwat [Mon, 26 Apr 2021 13:37:44 +0000 (15:37 +0200)]
emscripten: disable big endian test

This test should not run on the emscripten platform because of :
https://github.com/emscripten-core/emscripten/blob/dff33368427fba16745c8ce52f11484a67b2855d/cmake/Modules/TestBigEndian.cmake#L5

3 years agoImport files tiff and yuv(raw) (#1316)
Jamaika1 [Thu, 6 May 2021 17:30:34 +0000 (19:30 +0200)]
Import files tiff and yuv(raw) (#1316)

3 years agoMerge pull request #1350 from rouault/remove_jpwl_jp3d_mj2
Even Rouault [Thu, 6 May 2021 11:40:43 +0000 (13:40 +0200)]
Merge pull request #1350 from rouault/remove_jpwl_jp3d_mj2

Remove obsolete components JPWL, JP3D and MJ2

3 years agoRemove obsolete components JPWL, JP3D and MJ2 1350/head
Even Rouault [Tue, 4 May 2021 17:21:45 +0000 (19:21 +0200)]
Remove obsolete components JPWL, JP3D and MJ2

3 years agoMerge pull request #1348 from rouault/fix_kdu
Even Rouault [Tue, 4 May 2021 17:15:06 +0000 (19:15 +0200)]
Merge pull request #1348 from rouault/fix_kdu

tools/travis-ci/install.sh: fix links to Kakadu and jpylyzer binaries

3 years ago.travis.yml: disable tests that no longer pass for unknown reason 1348/head
Even Rouault [Tue, 4 May 2021 16:55:43 +0000 (18:55 +0200)]
.travis.yml: disable tests that no longer pass for unknown reason

3 years agotools/travis-ci/install.sh: fix links to Kakadu and jpylyzer binaries
Even Rouault [Tue, 4 May 2021 14:27:05 +0000 (16:27 +0200)]
tools/travis-ci/install.sh: fix links to Kakadu and jpylyzer binaries

3 years agoMerge pull request #1321 from ffontaine/master 1329/head
Even Rouault [Sun, 10 Jan 2021 22:58:37 +0000 (23:58 +0100)]
Merge pull request #1321 from ffontaine/master

Fix cmake file with DESTDIR

3 years agocmake/OpenJPEGConfig.cmake: replace ABSOLUTE by REALPATH 1321/head
Fabrice Fontaine [Thu, 7 Jan 2021 13:11:26 +0000 (14:11 +0100)]
cmake/OpenJPEGConfig.cmake: replace ABSOLUTE by REALPATH

Fix #1174 by replacing ABSOLUTE by REALPATH which will resolve symlinks:
https://cmake.org/cmake/help/latest/command/get_filename_component.html

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3 years agoRevert "Use INC_DIR for OPENJPEG_INCLUDE_DIRS (fixes uclouvain#1174)"
Fabrice Fontaine [Thu, 7 Jan 2021 13:09:50 +0000 (14:09 +0100)]
Revert "Use INC_DIR for OPENJPEG_INCLUDE_DIRS (fixes uclouvain#1174)"

This reverts commit 65586374d639cfc0104419992f9022174b412594 which
breaks cross-compilation of poppler under buildroot (because of
DESTDIR usage).

3 years agoMerge pull request #867 from pseiderer/fix-lcms2-static-linking-using-pgk-config
Even Rouault [Mon, 4 Jan 2021 18:42:30 +0000 (19:42 +0100)]
Merge pull request #867 from pseiderer/fix-lcms2-static-linking-using-pgk-config

Fix lcms2 static linking using pgk config

3 years agothirdparty: lcms2: append flags found by pkg-config if available 867/head
Peter Seiderer [Fri, 11 Nov 2016 22:35:13 +0000 (23:35 +0100)]
thirdparty: lcms2: append flags found by pkg-config if available

This change allows to get all required CFLAGS/LDFLAGS in case of static only
build.

Fixes a buildroot build failure (see [1], [2] and [3]).

[1] http://autobuild.buildroot.net/results/5ce/5cee20afd8bef5268832cddcb3a5270746be7a57
[2] http://lists.busybox.net/pipermail/buildroot/2016-November/177187.html
[3] http://lists.busybox.net/pipermail/buildroot/2016-November/177188.html

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Depends on https://github.com/uclouvain/openjpeg/pull/866

3 years agoMerge pull request #866 from tSed/master
Even Rouault [Mon, 4 Jan 2021 13:06:43 +0000 (14:06 +0100)]
Merge pull request #866 from tSed/master

fix static build only against tiff and its indirect dependencies

3 years agoMerge pull request #1317 from ffontaine/master
Even Rouault [Mon, 4 Jan 2021 09:45:52 +0000 (10:45 +0100)]
Merge pull request #1317 from ffontaine/master

CMakeLists.txt: Don't require a C++ compiler

3 years agoCMakeLists.txt: Don't require a C++ compiler 1317/head
Peter Korsgaard [Mon, 4 Jan 2021 08:05:42 +0000 (09:05 +0100)]
CMakeLists.txt: Don't require a C++ compiler

By default, CMake assumes that the project is using both C and C++.  By
explicitly passing 'C' as argument of the project() macro, we tell CMake
that only C is used, which prevents CMake from erroring out if a C++
compiler doesn't exist.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
[Retrieved (and slightly updated by adding enable_language(CXX) if
WITH_ASTYLE is set) from:
https://git.buildroot.net/buildroot/tree/package/openjpeg/0003-CMakeLists.txt-Don-t-require-a-C-compiler.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3 years agoFix Windows build
Even Rouault [Thu, 31 Dec 2020 13:54:59 +0000 (14:54 +0100)]
Fix Windows build

3 years agopatch provided 3rdparty zlib to work with MacOS
Antonin Descampe [Thu, 31 Dec 2020 10:06:28 +0000 (11:06 +0100)]
patch provided 3rdparty zlib to work with MacOS

3 years agoAdd HOWTO-RELEASE
Even Rouault [Tue, 29 Dec 2020 14:34:19 +0000 (15:34 +0100)]
Add HOWTO-RELEASE

3 years agoComment back opj_previous_version in abi_check.sh
Even Rouault [Tue, 29 Dec 2020 14:01:40 +0000 (15:01 +0100)]
Comment back opj_previous_version in abi_check.sh

3 years agoabi_check.sh: Update version number for automatic abi check
Even Rouault [Tue, 29 Dec 2020 13:46:50 +0000 (14:46 +0100)]
abi_check.sh: Update version number for automatic abi check

3 years agoMerge pull request #1312 from stweil/news
Even Rouault [Mon, 28 Dec 2020 21:58:58 +0000 (22:58 +0100)]
Merge pull request #1312 from stweil/news

Fix year in NEWS

3 years agoFix year in NEWS 1312/head
Stefan Weil [Mon, 28 Dec 2020 21:52:34 +0000 (22:52 +0100)]
Fix year in NEWS

Signed-off-by: Stefan Weil <sw@weilnetz.de>
3 years agoPrepare for v2.4.0 v2.4.0
Even Rouault [Mon, 28 Dec 2020 20:55:55 +0000 (21:55 +0100)]
Prepare for v2.4.0

3 years agoMerge pull request #1310 from Jamaika1/patch-1
Even Rouault [Mon, 28 Dec 2020 20:49:48 +0000 (21:49 +0100)]
Merge pull request #1310 from Jamaika1/patch-1

Change defined WIN32

3 years agoMerge pull request #1307 from cygwin-lem/pr_use-OPENJPEG_INSTALL_DOC_DIR-to-DESTINATI...
Even Rouault [Mon, 28 Dec 2020 18:05:14 +0000 (19:05 +0100)]
Merge pull request #1307 from cygwin-lem/pr_use-OPENJPEG_INSTALL_DOC_DIR-to-DESTINATION-of-HTMLs

Set ${OPENJPEG_INSTALL_DOC_DIR} to DESTINATION of HTMLs

3 years agoMerge pull request #1308 from timgates42/bugfix_typo_produced
Even Rouault [Mon, 28 Dec 2020 18:04:28 +0000 (19:04 +0100)]
Merge pull request #1308 from timgates42/bugfix_typo_produced

docs: fix simple typo, producted -> produced

3 years agoChange defined WIN32 1310/head
Jamaika1 [Mon, 21 Dec 2020 06:59:12 +0000 (07:59 +0100)]
Change defined WIN32

3 years agodocs: fix simple typo, producted -> produced 1308/head
Tim Gates [Wed, 16 Dec 2020 10:19:17 +0000 (21:19 +1100)]
docs: fix simple typo, producted -> produced

There is a small typo in thirdparty/include/zlib.h, thirdparty/libz/zlib.h.

Should read `produced` rather than `producted`.

3 years agoSet ${OPENJPEG_INSTALL_DOC_DIR} to DESTINATION of HTMLs 1307/head
Lemures Lemniscati [Mon, 14 Dec 2020 14:00:04 +0000 (23:00 +0900)]
Set ${OPENJPEG_INSTALL_DOC_DIR} to DESTINATION of HTMLs

Use ${OPENJPEG_INSTALL_DOC_DIR} as DESTINATION of HTML documents,
instead of share/doc.

3 years agoMerge pull request #1306 from matthew-sharp/master
Even Rouault [Thu, 10 Dec 2020 14:55:41 +0000 (15:55 +0100)]
Merge pull request #1306 from matthew-sharp/master

Use INC_DIR for OPENJPEG_INCLUDE_DIRS (fixes uclouvain#1174)

3 years agoUse INC_DIR for OPENJPEG_INCLUDE_DIRS (fixes uclouvain#1174) 1306/head
Matthew Sharp [Wed, 9 Dec 2020 23:17:46 +0000 (10:17 +1100)]
Use INC_DIR for OPENJPEG_INCLUDE_DIRS (fixes uclouvain#1174)
This fixes the case where the cmake file is accessed via a symlink.

3 years agoMerge pull request #1304 from rouault/fix_1302
Even Rouault [Sat, 5 Dec 2020 10:39:23 +0000 (11:39 +0100)]
Merge pull request #1304 from rouault/fix_1302

pi.c: avoid out of bounds access with POC (fixes #1302)

3 years agopi.c: avoid out of bounds access with POC (fixes #1302) 1304/head
Even Rouault [Fri, 4 Dec 2020 19:45:25 +0000 (20:45 +0100)]
pi.c: avoid out of bounds access with POC (fixes #1302)

3 years agoMerge pull request #1303 from zodf0055980/fix#1283
Even Rouault [Fri, 4 Dec 2020 19:37:43 +0000 (20:37 +0100)]
Merge pull request #1303 from zodf0055980/fix#1283

Encoder: grow again buffer size

3 years agoEncoder: grow again buffer size in opj_tcd_code_block_enc_allocate_data() (fixes... 1303/head
yuan [Fri, 4 Dec 2020 11:00:22 +0000 (19:00 +0800)]
Encoder: grow again buffer size in opj_tcd_code_block_enc_allocate_data() (fixes #1283)

3 years agoMerge pull request #1301 from rouault/fix_1299
Even Rouault [Wed, 2 Dec 2020 22:56:57 +0000 (23:56 +0100)]
Merge pull request #1301 from rouault/fix_1299

opj_j2k_write_sod(): avoid potential heap buffer overflow (fixes #1299) (probably master only)

3 years agoMerge pull request #1300 from rouault/complement_1293
Even Rouault [Wed, 2 Dec 2020 22:56:39 +0000 (23:56 +0100)]
Merge pull request #1300 from rouault/complement_1293

pi.c: avoid out of bounds access with POC (refs https://github.com/uclouvain/openjpeg/issues/1293#issuecomment-737122836)

3 years agoMerge pull request #1298 from rouault/fix_1297
Even Rouault [Wed, 2 Dec 2020 22:56:30 +0000 (23:56 +0100)]
Merge pull request #1298 from rouault/fix_1297

opj_t2_encode_packet(): avoid out of bound access of #1297, but likely not the proper fix

3 years agoopj_j2k_write_sod(): avoid potential heap buffer overflow (fixes #1299) (probably... 1301/head
Even Rouault [Wed, 2 Dec 2020 13:10:16 +0000 (14:10 +0100)]
opj_j2k_write_sod(): avoid potential heap buffer overflow (fixes #1299) (probably master only)

3 years agopi.c: avoid out of bounds access with POC (refs https://github.com/uclouvain/openjpeg... 1300/head
Even Rouault [Wed, 2 Dec 2020 13:02:17 +0000 (14:02 +0100)]
pi.c: avoid out of bounds access with POC (refs https://github.com/uclouvain/openjpeg/issues/1293#issuecomment-737122836)

3 years agoopj_t2_encode_packet(): avoid out of bound access of #1297, but likely not the proper fix 1298/head
Even Rouault [Wed, 2 Dec 2020 12:13:26 +0000 (13:13 +0100)]
opj_t2_encode_packet(): avoid out of bound access of #1297, but likely not the proper fix

3 years agoMerge pull request #1295 from rouault/fix_1293
Even Rouault [Wed, 2 Dec 2020 09:05:39 +0000 (10:05 +0100)]
Merge pull request #1295 from rouault/fix_1293

opj_j2k_setup_encoder(): validate POC compno0 and compno1 (fixes #1293)

3 years agoMerge pull request #1296 from rouault/workaround_1294
Even Rouault [Wed, 2 Dec 2020 09:05:31 +0000 (10:05 +0100)]
Merge pull request #1296 from rouault/workaround_1294

opj_t2_encode_packet(): avoid out of bound access of #1294, but likely not the proper fix

3 years agoopj_j2k_setup_encoder(): validate POC compno0 (fixes #1293) 1295/head
Even Rouault [Tue, 1 Dec 2020 18:39:09 +0000 (19:39 +0100)]
opj_j2k_setup_encoder(): validate POC compno0 (fixes #1293)

3 years agoopj_t2_encode_packet(): avoid out of bound access of #1294, but likely not the proper fix 1296/head
Even Rouault [Tue, 1 Dec 2020 18:51:35 +0000 (19:51 +0100)]
opj_t2_encode_packet(): avoid out of bound access of #1294, but likely not the proper fix

3 years agoMerge pull request #1292 from rouault/fix_1286
Even Rouault [Tue, 1 Dec 2020 10:35:59 +0000 (11:35 +0100)]
Merge pull request #1292 from rouault/fix_1286

Encoder: avoid global buffer overflow on irreversible conversion when…

3 years agoEncoder: avoid global buffer overflow on irreversible conversion when too many decomp... 1292/head
Even Rouault [Mon, 30 Nov 2020 21:37:07 +0000 (22:37 +0100)]
Encoder: avoid global buffer overflow on irreversible conversion when too many decomposition levels are specified (fixes #1286)

3 years agoMerge pull request #1291 from rouault/tnsot_zero_missing_eoc
Even Rouault [Mon, 30 Nov 2020 22:28:31 +0000 (23:28 +0100)]
Merge pull request #1291 from rouault/tnsot_zero_missing_eoc

Decoding: deal with some SPOT6 images that have tiles with a single tile-part with TPsot == 0 and TNsot == 0, and with missing EOC

3 years agopngtoimage(): fix wrong computation of x1,y1 if -d option is used, that would result...
Even Rouault [Mon, 30 Nov 2020 21:31:51 +0000 (22:31 +0100)]
pngtoimage(): fix wrong computation of x1,y1 if -d option is used, that would result in a heap buffer overflow (fixes #1284)

3 years agoDecoding: deal with some SPOT6 images that have tiles with a single tile-part with... 1291/head
Even Rouault [Mon, 30 Nov 2020 16:36:27 +0000 (17:36 +0100)]
Decoding: deal with some SPOT6 images that have tiles with a single tile-part with TPsot == 0 and TNsot == 0, and with missing EOC

3 years agoMerge pull request #1288 from zodf0055980/master
Even Rouault [Fri, 27 Nov 2020 13:25:11 +0000 (14:25 +0100)]
Merge pull request #1288 from zodf0055980/master

Free p_tcd_marker_info to avoid memory leak

3 years agoFree p_tcd_marker_info to avoid memory leak 1288/head
yuan [Wed, 25 Nov 2020 16:22:49 +0000 (00:22 +0800)]
Free p_tcd_marker_info to avoid memory leak

3 years agoMerge pull request #1287 from zodf0055980/master
Even Rouault [Wed, 25 Nov 2020 15:59:46 +0000 (16:59 +0100)]
Merge pull request #1287 from zodf0055980/master

Encoder: grow again buffer size

3 years agoEncoder: grow again buffer size in opj_tcd_code_block_enc_allocate_data() (fixes... 1287/head
yuan [Wed, 25 Nov 2020 12:41:39 +0000 (20:41 +0800)]
Encoder: grow again buffer size in opj_tcd_code_block_enc_allocate_data() (fixes #1283)

3 years agoEncoder: grow again buffer size in opj_tcd_code_block_enc_allocate_data() (fixes... 1285/head
Even Rouault [Mon, 23 Nov 2020 17:14:02 +0000 (18:14 +0100)]
Encoder: grow again buffer size in opj_tcd_code_block_enc_allocate_data() (fixes #1283)

3 years agoEncoder: grow buffer size in opj_tcd_code_block_enc_allocate_data() to avoid write...
Even Rouault [Mon, 23 Nov 2020 12:49:05 +0000 (13:49 +0100)]
Encoder: grow buffer size in opj_tcd_code_block_enc_allocate_data() to avoid write heap buffer overflow in opj_mqc_flush (fixes #1283)

3 years agoFix typo in internal function name
Even Rouault [Mon, 23 Nov 2020 12:38:27 +0000 (13:38 +0100)]
Fix typo in internal function name

3 years agoMerge pull request #1253 from rouault/floating_point_irreversible_encoding
Even Rouault [Fri, 9 Oct 2020 11:25:27 +0000 (13:25 +0200)]
Merge pull request #1253 from rouault/floating_point_irreversible_encoding

Single-threaded performance improvements in forward DWT for 5-3 and 9-7 (and other improvements)

3 years agoBump Java compatibility from 1.5 to 1.6 (#1263)
Pei JIA [Wed, 23 Sep 2020 09:34:31 +0000 (02:34 -0700)]
Bump Java compatibility from 1.5 to 1.6 (#1263)

3 years agoMerge pull request #1276 from rouault/fix_1243
Even Rouault [Wed, 16 Sep 2020 09:52:10 +0000 (11:52 +0200)]
Merge pull request #1276 from rouault/fix_1243

Encoder: avoid uint32 overflow when allocating memory for codestream buffer (fixes #1243)

3 years agoEncoder: avoid uint32 overflow when allocating memory for codestream buffer (fixes... 1276/head
Even Rouault [Wed, 16 Sep 2020 09:27:53 +0000 (11:27 +0200)]
Encoder: avoid uint32 overflow when allocating memory for codestream buffer (fixes #1243)

3 years agoMerge pull request #1262 from rouault/fix_1261
Even Rouault [Tue, 30 Jun 2020 20:05:13 +0000 (22:05 +0200)]
Merge pull request #1262 from rouault/fix_1261

opj_decompress: fix double-free on input directory with mix of valid and invalid images

3 years agoopj_decompress: fix double-free on input directory with mix of valid and invalid... 1262/head
Even Rouault [Sun, 28 Jun 2020 12:19:59 +0000 (14:19 +0200)]
opj_decompress: fix double-free on input directory with mix of valid and invalid images (CVE-2020-15389)

Fixes #1261

Credits to @Ruia-ruia for reporting and analysis.

3 years agoMerge pull request #1260 from sebras/fix-issue-1259
Even Rouault [Mon, 22 Jun 2020 20:35:44 +0000 (22:35 +0200)]
Merge pull request #1260 from sebras/fix-issue-1259

openjp2: Plug image leak when failing to allocate codestream index.

3 years agoMerge pull request #1258 from sebras/fix-issue-1257
Even Rouault [Mon, 22 Jun 2020 20:12:08 +0000 (22:12 +0200)]
Merge pull request #1258 from sebras/fix-issue-1257

openjp2: Plug memory leak when setting data as TLS fails.

3 years agoopenjp2: Plug image leak when failing to allocate codestream index. 1260/head
Sebastian Rasmussen [Mon, 22 Jun 2020 18:18:19 +0000 (02:18 +0800)]
openjp2: Plug image leak when failing to allocate codestream index.

This fixes issue #1259.

3 years agoopenjp2: Plug memory leak when setting data as TLS fails. 1258/head
Sebastian Rasmussen [Mon, 22 Jun 2020 18:18:19 +0000 (02:18 +0800)]
openjp2: Plug memory leak when setting data as TLS fails.

Previously the Tier 1 handle was not freed when setting it as
TLS failed.

This fixes issue #1257.

3 years agoMerge pull request #1256 from sebras/master
Even Rouault [Mon, 22 Jun 2020 19:03:23 +0000 (21:03 +0200)]
Merge pull request #1256 from sebras/master

openjp2: Error out if failing to create Tier 1 handle.

3 years agoopenjp2: Error out if failing to create Tier 1 handle. 1256/head
Sebastian Rasmussen [Mon, 22 Jun 2020 18:18:19 +0000 (02:18 +0800)]
openjp2: Error out if failing to create Tier 1 handle.

Previously when the handle failed to be created (e.g. when
opj_calloc returned NULL due to low memory), the code still
assumed that the t1 handle pointer was valid and dereferenced
NULL, causing a crash. After this commit OpenJPEG will instead
error out under this condition.

This fixes issue #1255.

3 years agoTesting for invalid values of width, height, numcomps (#1254)
szukw000 [Wed, 10 Jun 2020 15:40:50 +0000 (17:40 +0200)]
Testing for invalid values of width, height, numcomps (#1254)

3 years agoT1 encoder: speed-up by aggressive inlining and more cache friendly data organization 1253/head
Even Rouault [Sun, 24 May 2020 13:38:21 +0000 (15:38 +0200)]
T1 encoder: speed-up by aggressive inlining and more cache friendly data organization

~ 9% speed improvement seen on 10980x10980 uint16 image, T36JTT_20160914T074612_B02.tif
opj_compress time from 17.2s to 15.8s

3 years agoForward DWT 9-7: major speed up by vectorizing vertical pass
Even Rouault [Fri, 22 May 2020 21:57:51 +0000 (23:57 +0200)]
Forward DWT 9-7: major speed up by vectorizing vertical pass

`bench_dwt -I -encode` times goes from 8.6s to 2.1s

3 years agoForward DWT 5-3: major speed up by vectorizing vertical pass
Even Rouault [Fri, 22 May 2020 15:50:15 +0000 (17:50 +0200)]
Forward DWT 5-3: major speed up by vectorizing vertical pass

`bench_dwt -encode` times goes from 7.9s to 1.7s

4 years agoForward DWT: small code refactoring to allow future improvements for the vertical...
Even Rouault [Fri, 22 May 2020 13:58:47 +0000 (15:58 +0200)]
Forward DWT: small code refactoring to allow future improvements for the vertical pass

4 years agodwt.c: remove unused typedef
Even Rouault [Fri, 22 May 2020 13:06:29 +0000 (15:06 +0200)]
dwt.c: remove unused typedef

4 years agoForward DWT 5x3: performance improvements in horizontal pass, and modest in vertical...
Even Rouault [Fri, 22 May 2020 13:03:40 +0000 (15:03 +0200)]
Forward DWT 5x3: performance improvements in horizontal pass, and modest in vertical pass

4 years agoForward DWT: small code refactoring to allow future improvements for the horizontal...
Even Rouault [Thu, 21 May 2020 19:20:19 +0000 (21:20 +0200)]
Forward DWT: small code refactoring to allow future improvements for the horizontal pass

4 years agoSpeed-up 9x7 IDWD by ~30% with OPJ_NUM_THREADS=2
Even Rouault [Thu, 21 May 2020 14:54:48 +0000 (16:54 +0200)]
Speed-up 9x7 IDWD by ~30% with OPJ_NUM_THREADS=2

"bench_dwt -I" time goes from 2.2s to 1.5s

4 years agoRemove useless + 5U margin in opj_dwt_decode_tile_97()
Even Rouault [Thu, 21 May 2020 09:24:29 +0000 (11:24 +0200)]
Remove useless + 5U margin in opj_dwt_decode_tile_97()

Nothing in code analysis nor test suite shows that this margin is
needed.
It dates back to commit dbeebe72b9d35f6ff807c21c7f217b569fa894f6
where vector 9x7 decoding was introduced.

4 years agoSpeed-up 9x7 IDWD by ~20%
Even Rouault [Thu, 21 May 2020 09:23:00 +0000 (11:23 +0200)]
Speed-up 9x7 IDWD by ~20%

"bench_dwt -I" time goes from 2.8s to 2.2s

4 years agobench_dwt.c: add a -I switch to test irreversible FWDT/IDWT
Even Rouault [Wed, 20 May 2020 21:20:48 +0000 (23:20 +0200)]
bench_dwt.c: add a -I switch to test irreversible FWDT/IDWT