openjpeg.git
6 weeks agoMerge pull request #1518 from dg0yt/static-windows master
Even Rouault [Thu, 29 Feb 2024 20:21:11 +0000 (21:21 +0100)]
Merge pull request #1518 from dg0yt/static-windows

Fix export of OPJ_STATIC, cleanup

6 weeks agoMerge pull request #1519 from stweil/crlf
Even Rouault [Thu, 29 Feb 2024 20:21:04 +0000 (21:21 +0100)]
Merge pull request #1519 from stweil/crlf

Fix line endings (CRLF -> LF)

6 weeks agoFix line endings (CRLF -> LF) 1519/head
Stefan Weil [Thu, 29 Feb 2024 19:51:33 +0000 (20:51 +0100)]
Fix line endings (CRLF -> LF)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
7 weeks agoRefactor build of both types of linkage 1518/head
Kai Pastor [Thu, 29 Feb 2024 07:20:07 +0000 (08:20 +0100)]
Refactor build of both types of linkage

7 weeks agoFix export of OPJ_STATIC macro
Kai Pastor [Thu, 29 Feb 2024 07:15:06 +0000 (08:15 +0100)]
Fix export of OPJ_STATIC macro

7 weeks agoMerge pull request #1517 from stweil/typos
Even Rouault [Wed, 28 Feb 2024 15:49:26 +0000 (16:49 +0100)]
Merge pull request #1517 from stweil/typos

Fix some typos (found by `codespell` and `typos`)

7 weeks agoMerge pull request #1516 from stweil/actions
Even Rouault [Wed, 28 Feb 2024 15:47:51 +0000 (16:47 +0100)]
Merge pull request #1516 from stweil/actions

Update GitHub checkout action to latest version

7 weeks agoFix some typos (found by `codespell` and `typos`) 1517/head
Stefan Weil [Wed, 28 Feb 2024 14:28:51 +0000 (15:28 +0100)]
Fix some typos (found by `codespell` and `typos`)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
7 weeks agoUpdate GitHub checkout action to latest version 1516/head
Stefan Weil [Wed, 28 Feb 2024 14:19:12 +0000 (15:19 +0100)]
Update GitHub checkout action to latest version

This fixes lots of warnings like this one:

    The following actions uses node12 which is deprecated and will be forced to run on node16:
    actions/checkout@v2. For more info:
    https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

Signed-off-by: Stefan Weil <sw@weilnetz.de>
7 weeks agoMerge pull request #1515 from rouault/fix_1514
Even Rouault [Wed, 28 Feb 2024 13:29:42 +0000 (14:29 +0100)]
Merge pull request #1515 from rouault/fix_1514

openjpeg.h: make sure to include opj_config.h (fixes #1514)

7 weeks agoopj_config.h.cmake.in: add inclusion guard 1515/head
Even Rouault [Tue, 27 Feb 2024 14:54:37 +0000 (15:54 +0100)]
opj_config.h.cmake.in: add inclusion guard

7 weeks agoopenjpeg.h: make sure to include opj_config.h (fixes #1514)
Even Rouault [Tue, 27 Feb 2024 11:50:37 +0000 (12:50 +0100)]
openjpeg.h: make sure to include opj_config.h (fixes #1514)

It was previously included by openjpeg.h

7 weeks agoupdate HOWTO-RELEASE
Even Rouault [Mon, 26 Feb 2024 14:36:19 +0000 (15:36 +0100)]
update HOWTO-RELEASE

7 weeks agoupdate HOWTO-RELEASE
Even Rouault [Mon, 26 Feb 2024 14:35:24 +0000 (15:35 +0100)]
update HOWTO-RELEASE

7 weeks agoabi_check.sh: comment OPJ_PREVIOUS_VERSION
Even Rouault [Mon, 26 Feb 2024 14:34:07 +0000 (15:34 +0100)]
abi_check.sh: comment OPJ_PREVIOUS_VERSION

7 weeks agoabi_check.sh: Update version number for automatic abi check (2.5.0->2.5.1)
Even Rouault [Mon, 26 Feb 2024 14:25:08 +0000 (15:25 +0100)]
abi_check.sh: Update version number for automatic abi check (2.5.0->2.5.1)

7 weeks agoPrepare for OpenJPEG v2.5.1 release v2.5.1
Even Rouault [Mon, 26 Feb 2024 14:16:49 +0000 (15:16 +0100)]
Prepare for OpenJPEG v2.5.1 release

8 weeks agoMerge pull request #1511 from rouault/fix_1488_bis
Even Rouault [Sun, 18 Feb 2024 17:48:29 +0000 (18:48 +0100)]
Merge pull request #1511 from rouault/fix_1488_bis

opj_t2_read_packet_header(): avoid unsigned integer overflow

8 weeks agoopj_t2_read_packet_header(): avoid unsigned integer overflow (alternate fix to https... 1511/head
Even Rouault [Sun, 18 Feb 2024 16:59:08 +0000 (17:59 +0100)]
opj_t2_read_packet_header(): avoid unsigned integer overflow (alternate fix to https://github.com/uclouvain/openjpeg/pull/1488)

8 weeks agoMerge pull request #1510 from rouault/fix_1505
Even Rouault [Sun, 18 Feb 2024 16:43:23 +0000 (17:43 +0100)]
Merge pull request #1510 from rouault/fix_1505

opj_dwt_decode_tile(): avoid potential UndefinedBehaviorSanitizer 'applying zero offset to null pointer' (fixes #1505)

8 weeks agoMerge pull request #1507 from kmilos/patch-1
Even Rouault [Sun, 18 Feb 2024 16:26:37 +0000 (17:26 +0100)]
Merge pull request #1507 from kmilos/patch-1

Always install pkgconfig files

8 weeks agoMerge pull request #1509 from rouault/fix_sycc420_to_rgb
Even Rouault [Sun, 18 Feb 2024 16:18:36 +0000 (17:18 +0100)]
Merge pull request #1509 from rouault/fix_sycc420_to_rgb

opj_decompress: fix off-by-one read heap-buffer-overflow in sycc420_to_rgb() when x0 and y0 are odd (CVE-2021-3575, fixes #1347)

8 weeks agoopj_dwt_decode_tile(): avoid potential UndefinedBehaviorSanitizer 'applying zero... 1510/head
Even Rouault [Sun, 18 Feb 2024 16:17:00 +0000 (17:17 +0100)]
opj_dwt_decode_tile(): avoid potential UndefinedBehaviorSanitizer 'applying zero offset to null pointer' (fixes #1505)

8 weeks agoopj_decompress: fix off-by-one read heap-buffer-overflow in sycc420_to_rgb() when... 1509/head
Even Rouault [Sun, 18 Feb 2024 16:02:25 +0000 (17:02 +0100)]
opj_decompress: fix off-by-one read heap-buffer-overflow in sycc420_to_rgb() when x0 and y0 are odd (CVE-2021-3575, fixes #1347)

2 months agoRemove BUILD_PKGCONFIG_FILES 1507/head
Miloš Komarčević [Tue, 13 Feb 2024 14:28:36 +0000 (15:28 +0100)]
Remove BUILD_PKGCONFIG_FILES

2 months agoAlways install pkgconfig files
Miloš Komarčević [Tue, 13 Feb 2024 14:22:07 +0000 (15:22 +0100)]
Always install pkgconfig files

They are supported on all platforms

3 months agoMerge pull request #1493 from domin144/cmake_version_file
Even Rouault [Sat, 13 Jan 2024 11:48:18 +0000 (12:48 +0100)]
Merge pull request #1493 from domin144/cmake_version_file

Add cmake version file

3 months agoAdd cmake version file 1493/head
Dominik Wójt [Wed, 6 Dec 2023 20:04:40 +0000 (21:04 +0100)]
Add cmake version file

3 months agoMerge pull request #1503 from domin144/drop_cmake_less_3.5
Even Rouault [Mon, 8 Jan 2024 18:00:53 +0000 (19:00 +0100)]
Merge pull request #1503 from domin144/drop_cmake_less_3.5

CMake: drop support for cmake < 3.5

3 months agoCMake: drop support for cmake < 3.5 1503/head
Dominik Wójt [Mon, 8 Jan 2024 17:07:04 +0000 (18:07 +0100)]
CMake: drop support for cmake < 3.5

Compatibility for cmake version < 3.5 is now deprecated in cmake and
specifing version below 3.5 in cmake_minimum_required produces a
warning.[1]

[1] https://cmake.org/cmake/help/latest/release/3.27.html#deprecated-and-removed-features

3 months agoMerge pull request #1502 from scaramallion/fix-compiler-error
Even Rouault [Sun, 7 Jan 2024 17:53:01 +0000 (18:53 +0100)]
Merge pull request #1502 from scaramallion/fix-compiler-error

Fix compiler error on Windows

3 months agoFix compiler error on Windows 1502/head
scaramallion [Fri, 5 Jan 2024 00:21:15 +0000 (11:21 +1100)]
Fix compiler error on Windows

4 months agoht_dec.c: Improve MSVC arm64 popcount performance (#1479)
Peter Johnson [Sat, 9 Dec 2023 21:02:11 +0000 (13:02 -0800)]
ht_dec.c: Improve MSVC arm64 popcount performance (#1479)

Use NEON instructions for ARM64 (implementation based on microsoft/STL#2127).

Godbolt output here: https://godbolt.org/z/q7GPTqT14

4 months agoMerge pull request #1496 from rouault/fix_1480
Even Rouault [Fri, 8 Dec 2023 16:23:24 +0000 (17:23 +0100)]
Merge pull request #1496 from rouault/fix_1480

opj_tcd_dc_level_shift_decode(): avoid increment nullptr (fixes #1480)

4 months agoMerge pull request #1490 from headshog/fix-j2k
Even Rouault [Fri, 8 Dec 2023 15:47:34 +0000 (16:47 +0100)]
Merge pull request #1490 from headshog/fix-j2k

Integer Overflow at j2k.c:3962

4 months agoMerge pull request #1491 from headshog/fix-j2k-header
Even Rouault [Fri, 8 Dec 2023 15:47:27 +0000 (16:47 +0100)]
Merge pull request #1491 from headshog/fix-j2k-header

Integer Overflow at j2k.c:11114

4 months agoMerge pull request #1492 from headshog/fix-ht-dec
Even Rouault [Fri, 8 Dec 2023 15:47:20 +0000 (16:47 +0100)]
Merge pull request #1492 from headshog/fix-ht-dec

fix ht_dec.c:1215

4 months agoopj_tcd_dc_level_shift_decode(): avoid increment nullptr (fixes #1480) 1496/head
Even Rouault [Fri, 8 Dec 2023 15:05:12 +0000 (16:05 +0100)]
opj_tcd_dc_level_shift_decode(): avoid increment nullptr (fixes #1480)

(likely harmless issue as we don't dereference it)

4 months agoMerge pull request #1484 from mayeut/mandatory-inttypes-stdint
Even Rouault [Fri, 8 Dec 2023 14:55:00 +0000 (15:55 +0100)]
Merge pull request #1484 from mayeut/mandatory-inttypes-stdint

Require `stdint.h` & `inttypes.h`

4 months agoMerge pull request #1494 from tomoaki0705/suppress_warning_clang
Even Rouault [Fri, 8 Dec 2023 14:36:22 +0000 (15:36 +0100)]
Merge pull request #1494 from tomoaki0705/suppress_warning_clang

suppress warning during build using clang

4 months agoopj_t1_ht_decode_cblk(): avoid memcpy() with 0-input size and nullptr destination... 1492/head
headshog [Wed, 6 Dec 2023 14:57:41 +0000 (17:57 +0300)]
opj_t1_ht_decode_cblk(): avoid memcpy() with 0-input size and nullptr destination. fix ht_dec.c:1215 (#1492)

4 months agofix j2k.c:11114 1491/head
headshog [Wed, 6 Dec 2023 14:47:02 +0000 (17:47 +0300)]
fix j2k.c:11114

4 months agoopj_j2k_merge_ppm(): avoid unsigned-integer-overflow at j2k.c:3962 (#1490) 1490/head
headshog [Wed, 6 Dec 2023 14:30:29 +0000 (17:30 +0300)]
opj_j2k_merge_ppm(): avoid unsigned-integer-overflow at j2k.c:3962 (#1490)

4 months agoMerge pull request #1495 from rouault/update_kdu
Even Rouault [Fri, 8 Dec 2023 13:33:49 +0000 (14:33 +0100)]
Merge pull request #1495 from rouault/update_kdu

Fix CI

4 months agotools/travis-ci/install.sh: workaround issue with jpylyzer on Mac 1495/head
Even Rouault [Fri, 8 Dec 2023 11:06:51 +0000 (12:06 +0100)]
tools/travis-ci/install.sh: workaround issue with jpylyzer on Mac

4 months agosuppress warning during build using clang 1494/head
Tomoaki Teshima [Fri, 8 Dec 2023 11:56:37 +0000 (20:56 +0900)]
suppress warning during build using clang

4 months agoCI: update KDU to new version (older one no longer available)
Even Rouault [Fri, 8 Dec 2023 10:40:31 +0000 (11:40 +0100)]
CI: update KDU to new version (older one no longer available)

4 months agoFixed typos (#1486)
Andrew Murray [Fri, 8 Dec 2023 10:22:56 +0000 (21:22 +1100)]
Fixed typos (#1486)

6 months agoRequire `stdint.h` & `inttypes.h` 1484/head
mayeut [Sun, 24 Sep 2023 11:54:28 +0000 (13:54 +0200)]
Require `stdint.h` & `inttypes.h`

With #1450 which goes with 480cc9d49775d018c19ce0e01f6be27858d63d39 "Remove support for non-C99 compilers (like VS2010) that don't support snprintf()",
support for MSVC versions prior to vs2015 is dropped: https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010

This means that all supported MSVC versions do have `stdint.h` & `inttypes.h` now.
For non windows platforms, those headers were already mandatory.

Make them mandatory for all builds.

6 months agoMerge pull request #1482 from mayeut/use-opj_uint_ceildiv
Even Rouault [Sat, 23 Sep 2023 12:42:15 +0000 (14:42 +0200)]
Merge pull request #1482 from mayeut/use-opj_uint_ceildiv

fix: use `opj_uint_ceildiv` instead of `opj_int_ceildiv` when necessary

6 months agochore: GHA Ubuntu 22.04 now uses gcc 11.4.0 1482/head
mayeut [Sat, 23 Sep 2023 12:16:30 +0000 (14:16 +0200)]
chore: GHA Ubuntu 22.04 now uses gcc 11.4.0

6 months agofix: use `opj_uint_ceildiv` instead of `opj_int_ceildiv` when necessary
mayeut [Sat, 23 Sep 2023 09:02:54 +0000 (11:02 +0200)]
fix: use `opj_uint_ceildiv` instead of `opj_int_ceildiv` when necessary

There are a bunch of loc where we can see a usage of `opj_int_ceildiv`:
```
(OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)a, (OPJ_INT32)b);
```
where a & b are `OPJ_UINT32`.

This can lead to overflow/underflow for some a/b combinations.
Replace those calls by `opj_uint_ceildiv` instead to always get a correct result.

This also allows some valid single tile images with huge tile size to be decoded properly.
Fix #1438

12 months agoMerge pull request #1463 from rouault/fix_570
Even Rouault [Sun, 26 Mar 2023 14:08:24 +0000 (16:08 +0200)]
Merge pull request #1463 from rouault/fix_570

opj_jp2_read_header(): move setting color_space here instead in opj_jp2_decode()/get_tile() (fixes #570)

12 months agoopj_jp2_read_header(): move setting icc_profile here instead in opj_jp2_decode()... 1463/head
Even Rouault [Sun, 26 Mar 2023 12:03:59 +0000 (14:03 +0200)]
opj_jp2_read_header(): move setting icc_profile here instead in opj_jp2_decode()/get_tile() + add unit test (fixes #570)

13 months agoopj_jp2_read_header(): move setting color_space here instead in opj_jp2_decode()...
Even Rouault [Fri, 17 Mar 2023 17:16:35 +0000 (18:16 +0100)]
opj_jp2_read_header(): move setting color_space here instead in opj_jp2_decode()/get_tile() (fixes #570)

13 months agoMerge pull request #1462 from sebras/master
Even Rouault [Thu, 9 Mar 2023 20:15:39 +0000 (21:15 +0100)]
Merge pull request #1462 from sebras/master

CMake: error out on warnings for strict/missing prototypes.

13 months agoCMake: error out on warnings for strict/missing prototypes. 1462/head
Sebastian Rasmussen [Thu, 9 Mar 2023 18:20:58 +0000 (19:20 +0100)]
CMake: error out on warnings for strict/missing prototypes.

And fix strict-prototypes/missing-prototypes warnings.

13 months agoMerge pull request #1450 from markmentovai/no_sprintf
Even Rouault [Thu, 9 Mar 2023 19:06:58 +0000 (20:06 +0100)]
Merge pull request #1450 from markmentovai/no_sprintf

openjp2/j2k: replace sprintf calls with snprintf

13 months agoopenjp2/j2k: replace sprintf calls with snprintf 1450/head
Mark Mentovai [Mon, 7 Nov 2022 14:32:02 +0000 (09:32 -0500)]
openjp2/j2k: replace sprintf calls with snprintf

This makes it possible to build j2k.c without warnings using the macOS
13 SDK. Calls to sprintf are replaced with snprintf, passing appropriate
buffer sizes.

It doesn’t appear that any of the changed uses of sprintf were actually
unsafe, so no behavior change is expected aside from SDK compatibility.

The macOS 13 SDK deprecates sprintf as it’s difficult to use safely. The
deprecation warning message is visible when building C++, but it is not
normally visible when building plain C code due to a quirk in how
sprintf is declared in the SDK. However, the deprecation message is
visible when building plain C under Address Sanitizer
(-fsanitize=address). This discrepancy was discovered at
https://crbug.com/1381706 and reported to Apple with a copy at
https://openradar.appspot.com/FB11761475.

The macOS 13 SDK is packaged in Xcode 14.1, released on 2022-11-01. This
also affects the iOS 16 SDK and other 2022-era Apple OS SDKs packaged in
Xcode 14.0, released on 2022-09-12.

j2k.c is visible to the Chromium build via PDFium, and this change is
needed to allow Chromium to move forward to the macOS 13 SDK.

This change is limited to src/lib/openjp2. Other uses of sprintf were
found throughout openjpeg.

13 months agoRemove support for non-C99 compilers (like VS2010) that don't support snprintf()
Even Rouault [Tue, 7 Mar 2023 15:46:55 +0000 (16:46 +0100)]
Remove support for non-C99 compilers (like VS2010) that don't support snprintf()

13 months agoMerge pull request #1461 from rouault/fix_ci
Even Rouault [Tue, 7 Mar 2023 14:58:24 +0000 (15:58 +0100)]
Merge pull request #1461 from rouault/fix_ci

Fix CI

13 months agoFix CI 1461/head
Even Rouault [Tue, 7 Mar 2023 14:36:24 +0000 (15:36 +0100)]
Fix CI

13 months agoMerge pull request #1460 from rouault/fix_1459
Even Rouault [Tue, 7 Mar 2023 14:14:11 +0000 (15:14 +0100)]
Merge pull request #1460 from rouault/fix_1459

opj_t2_skip_packet_data(): avoid out-of-bounds reads on truncated images in non-strict mode (fixes #1459)

13 months agoopj_t2_skip_packet_data(): avoid out-of-bounds reads on truncated images in non-stric... 1460/head
Even Rouault [Tue, 7 Mar 2023 12:08:24 +0000 (13:08 +0100)]
opj_t2_skip_packet_data(): avoid out-of-bounds reads on truncated images in non-strict mode (fixes #1459)

14 months agoCMake: add missing GNUInstallDirs related substitutions (fixes #1424) (#1456)
autoantwort [Tue, 7 Feb 2023 00:08:38 +0000 (01:08 +0100)]
CMake: add missing GNUInstallDirs related substitutions (fixes #1424) (#1456)

17 months agoMerge pull request #1448 from rouault/fix_1447
Even Rouault [Wed, 19 Oct 2022 11:57:31 +0000 (13:57 +0200)]
Merge pull request #1448 from rouault/fix_1447

Fix incorrect decoding of image with large number of progression levels

18 months agoFix incorrect decoding of image with large number of progression levels 1448/head
Even Rouault [Tue, 18 Oct 2022 21:03:02 +0000 (23:03 +0200)]
Fix incorrect decoding of image with large number of progression levels

Fixes regression introduced per d27ccf01c68a31ad62b33d2dc1ba2bb1eeaafe7b

Fixes #1447

20 months agoFix Heap-buffer-overflow READ in opj_jp2_apply_pclr (#1441)
Aleks L [Fri, 12 Aug 2022 13:48:41 +0000 (14:48 +0100)]
Fix Heap-buffer-overflow READ in opj_jp2_apply_pclr (#1441)

The issue was found while fuzzing opencv:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47342

The read overflow triggered by reading `src[j]` in
```cpp
            for (j = 0; j < max; ++j) {
                dst[j] = src[j];
            }
```
The max is calculated as `new_comps[pcol].w * new_comps[pcol].h`, however the `src = old_comps[cmp].data;` which may have different `w` and `h` dimensions.

20 months agoMerge pull request #1440 from rouault/rate_alloc_speedup
Even Rouault [Fri, 12 Aug 2022 09:55:38 +0000 (11:55 +0200)]
Merge pull request #1440 from rouault/rate_alloc_speedup

Significant speed-up rate allocation by rate/distoratio ratio

20 months agoReplace the assert in mel_init to an if statement to address an issue with fuzzing...
Aous Naman [Thu, 11 Aug 2022 16:29:40 +0000 (02:29 +1000)]
Replace the assert in mel_init to an if statement to address an issue with fuzzing. (#1436)

Modified the mel_init code to replace the assert statement with an if statement, returning false when an incorrect sequence of bytes are encountered in the MEL segment.  Similar code should be added to the main MEL decoding subrountine, but the change is more involved; in any case, an incorrect sequence produces incorrect results, but should not be harmful or cause a crash.

20 months agoCleanup code related to quality layer allocation, and add a few safety checks 1440/head
Even Rouault [Thu, 11 Aug 2022 16:06:21 +0000 (18:06 +0200)]
Cleanup code related to quality layer allocation, and add a few safety checks

20 months agoSignificant speed-up rate allocation by rate/distoratio ratio
Even Rouault [Thu, 11 Aug 2022 14:46:55 +0000 (16:46 +0200)]
Significant speed-up rate allocation by rate/distoratio ratio

- Avoid doing 128 iterations all the time, and stop when the threshold
  doesn't vary much
- Avoid calling costly opj_t2_encode_packets() repeatdly when bisecting the
  layer ratio if the truncation points haven't changed since the last
  iteration.

When used with the GDAL gdal_translate application to convert a 11977 x
8745 raster with data type UInt16 and 8 channels, the conversion time
to JPEG2000 with 20 quality layers using disto/rate allocation (
-co "IC=C8" -co "JPEG2000_DRIVER=JP2OPENJPEG" -co "PROFILE=NPJE_NUMERICALLY_LOSSLESS"
creation options of the GDAL NITF driver) goes from 5m56 wall clock
(8m20s total, 12 vCPUs) down to 1m16 wall clock (3m45 total).

20 months agoMicro-optimization: use directly opj_bio_putbit() instead of opj_bio_write() to emit...
Even Rouault [Thu, 11 Aug 2022 14:41:57 +0000 (16:41 +0200)]
Micro-optimization: use directly opj_bio_putbit() instead of opj_bio_write() to emit single bit

20 months agoMerge pull request #1439 from arichardson/relocatable-cmake-config
Even Rouault [Thu, 11 Aug 2022 12:49:36 +0000 (14:49 +0200)]
Merge pull request #1439 from arichardson/relocatable-cmake-config

Make OpenJPEGConfig.cmake relocatable with CMake > 3.0

20 months agoMake OpenJPEGConfig.cmake relocatable with CMake > 3.0 1439/head
Alex Richardson [Thu, 11 Aug 2022 12:09:04 +0000 (12:09 +0000)]
Make OpenJPEGConfig.cmake relocatable with CMake > 3.0

Using CMakePackageConfigHelpers, we can generate a relocatable
OpenJPEGConfig.config, using the PATH_VARS feature to make
CMAKE_INSTALL_LIBDIR relative to the installed location.
This change is needed for me when cross-compiling since
CMAKE_INSTALL_FULL_LIBDIR is a path inside the sysroot rather than
an absolute path to the actual includes. Without this change poppler
ends up passing a -I flag that does not exist.

This includes fallback code for CMake 2.8, which adds a bit of complexity,
since I'm not sure if raising the minimum to 3.0 (now over 8 years old)
is acceptable.

20 months agoCMake: switch to GNUInstallDirs (#1424)
Thomas Bracht Laumann Jespersen [Sun, 7 Aug 2022 14:42:01 +0000 (16:42 +0200)]
CMake: switch to GNUInstallDirs  (#1424)

* Add GNUInstallDirs for standard installation directories

Distributions are given standard variables for already existing hooks.
Multiarch libdirs is taken care of automagically.
Raises minimum cmake version by a little.

* Handle CMAKE_INSTALL_xxx being absolute paths for .pc file generation

In some cases the CMAKE_INSTAL_{BIN,MAN,DOC,LIB,INCLUDE}DIR variables
may turn out to be absolute paths in which case prepending ${prefix} in
the pkg-config .pc files will result in incorrect values.

For .pc file generation, figure out if these variables are absolute and
omit the prefix in the configured file when so.

See: https://github.com/OSGeo/PROJ/commit/ab25e4b7ed9544e668282dcd293cfaaa2e56dbdf

21 months agoMerge pull request #1433 from rouault/fix_1432
Even Rouault [Thu, 30 Jun 2022 10:57:39 +0000 (12:57 +0200)]
Merge pull request #1433 from rouault/fix_1432

opj_t1_encode_cblk(): avoid undefined behaviour on fuzzed input (fixes #1432)

21 months agoopj_t1_encode_cblk(): avoid undefined behaviour on fuzzed input (fixes #1432) 1433/head
Even Rouault [Wed, 29 Jun 2022 09:47:58 +0000 (11:47 +0200)]
opj_t1_encode_cblk(): avoid undefined behaviour on fuzzed input (fixes #1432)

21 months agoMerge pull request #1431 from rouault/fix_1430
Even Rouault [Mon, 27 Jun 2022 21:21:58 +0000 (23:21 +0200)]
Merge pull request #1431 from rouault/fix_1430

Build: fix linking of executables on some systems where TIFF/LCMS2 static libraries are not in system directories (fixes #1430)

21 months agoBuild: fix linking of executables on some systems where TIFF/LCMS2 static libraries... 1431/head
Even Rouault [Mon, 27 Jun 2022 10:02:57 +0000 (12:02 +0200)]
Build: fix linking of executables on some systems where TIFF/LCMS2 static libraries are not in system directories (fixes #1430)

Note that the fix might be partial only for static-only builds (cf
comments)

Ammends PR #866 and #867

22 months agoHT_DEC: Fix opj_t1_allocate_buffers malloc size error (#1426) (fixes #1413)
Yuan [Tue, 31 May 2022 09:55:12 +0000 (17:55 +0800)]
HT_DEC: Fix opj_t1_allocate_buffers malloc size error (#1426) (fixes #1413)

23 months agoMerge pull request #1423 from Neumann-A/patch-1
Even Rouault [Mon, 16 May 2022 21:35:22 +0000 (23:35 +0200)]
Merge pull request #1423 from Neumann-A/patch-1

Fix windows arm builds

23 months agoMerge pull request #1421 from Biswa96/pkgconf-static
Even Rouault [Mon, 16 May 2022 21:25:54 +0000 (23:25 +0200)]
Merge pull request #1421 from Biswa96/pkgconf-static

pkgconfig: Define OPJ_STATIC for static linking with pkgconf

23 months agoFix windows arm builds 1423/head
Alexander Neumann [Mon, 16 May 2022 21:10:26 +0000 (23:10 +0200)]
Fix windows arm builds

23 months agopkgconfig: Define OPJ_STATIC for static linking with pkgconf 1421/head
Biswapriyo Nath [Sun, 15 May 2022 12:41:45 +0000 (18:11 +0530)]
pkgconfig: Define OPJ_STATIC for static linking with pkgconf

allows for the usage of $(pkgconf --static --cflags libopenjp2) to produce
the proper CFLAGS for static linking. Relies on pkgconf rather than pkg-config

23 months agoHOWTO-RELEASE: update
Even Rouault [Fri, 13 May 2022 18:17:50 +0000 (20:17 +0200)]
HOWTO-RELEASE: update

23 months agoabi_check.sh: comment OPJ_PREVIOUS_VERSION
Even Rouault [Fri, 13 May 2022 18:17:42 +0000 (20:17 +0200)]
abi_check.sh: comment OPJ_PREVIOUS_VERSION

23 months agoupdate tools/abi-tracker/openjpeg.json
Even Rouault [Fri, 13 May 2022 17:13:11 +0000 (19:13 +0200)]
update tools/abi-tracker/openjpeg.json

23 months agoabi_check.sh: Update version number for automatic abi check
Even Rouault [Fri, 13 May 2022 17:02:54 +0000 (19:02 +0200)]
abi_check.sh: Update version number for automatic abi check

23 months agoPrepare for 2.5.0 release v2.5.0
Even Rouault [Fri, 13 May 2022 16:54:29 +0000 (18:54 +0200)]
Prepare for 2.5.0 release

23 months agoSeparate fuzz targets to increase coverage (#1416)
Navidem [Fri, 13 May 2022 16:18:47 +0000 (11:18 -0500)]
Separate fuzz targets to increase coverage (#1416)

23 months agoMerge pull request #1386 from DavidKorczynski/cifuzz
Even Rouault [Fri, 13 May 2022 15:58:38 +0000 (17:58 +0200)]
Merge pull request #1386 from DavidKorczynski/cifuzz

CI: Add CIFuzz action

23 months agoopj_compress.c: usage formatting fix
Even Rouault [Sun, 8 May 2022 17:45:42 +0000 (19:45 +0200)]
opj_compress.c: usage formatting fix

23 months agoMerge pull request #1418 from LongerVision/master
Even Rouault [Sat, 7 May 2022 09:52:20 +0000 (11:52 +0200)]
Merge pull request #1418 from LongerVision/master

Java Support 1.8 now...

23 months agoMerge pull request #1419 from rouault/fix_ci
Even Rouault [Sat, 7 May 2022 09:52:09 +0000 (11:52 +0200)]
Merge pull request #1419 from rouault/fix_ci

tools/travis-ci/install.sh: git clone with https:// to fix 'The unaut…

23 months agoRename knownfailures-Ubuntu20.04-gcc9.3.0-x86_64-Release-3rdP.txt to knownfailures... 1419/head
Even Rouault [Sat, 7 May 2022 09:14:52 +0000 (11:14 +0200)]
Rename knownfailures-Ubuntu20.04-gcc9.3.0-x86_64-Release-3rdP.txt to knownfailures-Ubuntu20.04-gcc9.4.0-x86_64-Release-3rdP.txt

23 months ago.github/workflows/build.yml: force use of windows-2019 VM
Even Rouault [Sat, 7 May 2022 09:05:04 +0000 (11:05 +0200)]
.github/workflows/build.yml: force use of windows-2019 VM

23 months agotools/travis-ci/install.sh: git clone with https:// to fix 'The unauthenticated git...
Even Rouault [Sat, 7 May 2022 08:55:00 +0000 (10:55 +0200)]
tools/travis-ci/install.sh: git clone with https:// to fix 'The unauthenticated git protocol on port 9418 is no longer supported.'

23 months agoMerge pull request #1410 from rouault/fix_1404
Even Rouault [Sat, 7 May 2022 08:23:26 +0000 (10:23 +0200)]
Merge pull request #1410 from rouault/fix_1404

CMakeLists.txt: do not set INSTALL_NAME_DIR for MacOS builds for CMake >= 3.0 (fixes #1404)

23 months agoJAVA_SOURCE_VERSION from 1.6 to 1.8 1418/head
Pei Jia [Sat, 7 May 2022 01:27:27 +0000 (18:27 -0700)]
JAVA_SOURCE_VERSION from 1.6 to 1.8