summaryrefslogtreecommitdiff
path: root/src/lib
AgeCommit message (Collapse)Author
2025-09-30Don't limit bitrate here, as DoM takes care of it (DoM bug #1665).dcpomatic-2.5.4Carl Hetherington
2025-07-24pkgconfig: drop unused libraries from Libs.privateBenjamin Gilbert
Generate pkg-config Libs.private from the actual dependencies linked into our libraries, rather than hardcoding static lists, to avoid overlinking of library users when pkg-config is invoked with --static. libopenjpip doesn't actually link with libcurl, libfcgi, or libpthread, and neither of our libraries links with libm on Windows (which doesn't have libm).
2025-02-11Merge pull request #1576 from weanti/masterEven Rouault
code documentation updates
2025-02-11Fixed ICC profile copy failure on write (#1574)Mirco Miranda
2025-02-11code documentation updatesiantal
2025-01-16opj_jp2_read_header: Check for error after parsing header.Sebastian Rasmussen
Consider the case where the caller has not set the p_image pointer to NULL before calling opj_read_header(). If opj_j2k_read_header_procedure() fails while obtaining the rest of the marker segment when calling opj_stream_read_data() because the data stream is too short, then opj_j2k_read_header() will never have the chance to initialize p_image, leaving it uninitialized. opj_jp2_read_header() will check the p_image value whether opj_j2k_read_header() suceeded or failed. This may be detected as an error in valgrind or ASAN. The fix is to check whether opj_j2k_read_header() suceeded before using the output argument p_image.
2024-11-25Merge pull request #1565 from rouault/fix_1564Even Rouault
opj_j2k_add_tlmarker(): validate that current tile-part number if smaller that total number of tile-parts
2024-11-25opj_j2k_add_tlmarker(): validate that current tile-part number if smaller ↵Even Rouault
that total number of tile-parts Fixes #1564
2024-11-25Merge pull request #1560 from rouault/tune_TPSOT_FIXEven Rouault
Do not turn on 'TPsot==TNsot detection fix' when TNsot==1, and
2024-11-13Ammend previous commit to remove new OPJ_DPARAMETERS_DISABLE_TPSOT_FIX flag, ↵Even Rouault
and make it active when opj_decoder_set_strict_mode() is called with true
2024-11-13Amend fix of PR 1530 regarding m_sot_length checkEven Rouault
The fix of 2c0823cb30a70319c704565b59f496e490a3c7f9 (#1530) broke decoding of some JPEG2000 files where Isot==0, Psot==0, TPsot==0 and TNsot==0 like the following ones from the GDAL autotest suite: autotest/gdrivers/data/jpeg2000/stefan_full_rgba_alpha_1bit.jp2 autotest/gdrivers/data/jpeg2000/3_13bit_and_1bit.jp2
2024-11-13Do not turn on 'TPsot==TNsot detection fix' when TNsot==1, and add a ↵Even Rouault
OPJ_DPARAMETERS_DISABLE_TPSOT_FIX flag to disable it Adresses the use case of https://lists.osgeo.org/pipermail/gdal-dev/2024-November/059805.html where Sentinel2 L1C JPEG2000 files are made of a single tile-part per tile.
2024-11-13opj_j2k_setup_encoder(): set numgbits = 1 for Cinema2KEven Rouault
Fixes #1340
2024-09-19bench_dwt: Add assert for memory allocation failuresunyuechi
Fix memory allocation failure on K230
2024-09-06Add AVX2 and AVX512 optimization for wavelet transform (#1552)Tomasz
Encoder: performance gain ~0.1%​ Decoder: performance gain ~2.5%
2024-08-17fix: when EPH markers are specified, they are required.mayeut
reference from Rec. ITU-T T.800 (06/2019): - Table A.13 – Coding style parameter values for the Scod parameter - Section A.8.1 Start of packet (SOP) - Section A.8.2 End of packet header (EPH)
2024-07-01Use TLM markers to optimize opj_decode() (on a subset of tiles)Even Rouault
2024-07-01Use TLM markers to optimize opj_get_decoded_tile()Even Rouault
2024-06-24Avoid heap-buffer-overflow read on corrupted image in non-strict modeEven Rouault
Fixes #1535
2024-06-21opj_j2k_read_sod(): validate opj_stream_read_data() return to avoid ↵Even Rouault
potential later heap-buffer-overflow in in opj_t1_decode_cblk when disabling strict mode Fixes #1533
2024-06-14Support setting enumcs for CMYK and EYCC color space (#1529)Andrew Murray
2024-06-14Merge pull request #1528 from rouault/fix_ossfuzz_68763Even Rouault
opj_j2k_decode_tiles(): avoid use of uninitialized l_current_tile_no variable
2024-05-31Fix Integer Overflow at j2k.c:9614 (#1530)headshog
2024-05-06opj_j2k_decode_tiles(): avoid use of uninitialized l_current_tile_no variableEven Rouault
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68763
2024-04-20Do not allow header length to be zero in non-zero length packetAndrew Murray
2024-03-04Refactor build of both types of linkageKai Pastor
2024-03-04Fix export of OPJ_STATIC macroKai Pastor
2024-03-04Fix some typos (found by `codespell` and `typos`)Stefan Weil
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-02-27opj_config.h.cmake.in: add inclusion guardEven Rouault
2024-02-27openjpeg.h: make sure to include opj_config.h (fixes #1514)Even Rouault
It was previously included by openjpeg.h
2024-02-18opj_t2_read_packet_header(): avoid unsigned integer overflow (alternate fix ↵Even Rouault
to https://github.com/uclouvain/openjpeg/pull/1488)
2024-02-18Merge pull request #1510 from rouault/fix_1505Even Rouault
opj_dwt_decode_tile(): avoid potential UndefinedBehaviorSanitizer 'applying zero offset to null pointer' (fixes #1505)
2024-02-18opj_dwt_decode_tile(): avoid potential UndefinedBehaviorSanitizer 'applying ↵Even Rouault
zero offset to null pointer' (fixes #1505)
2024-01-08CMake: drop support for cmake < 3.5Dominik Wójt
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
2024-01-05Fix compiler error on Windowsscaramallion
2023-12-09ht_dec.c: Improve MSVC arm64 popcount performance (#1479)Peter Johnson
Use NEON instructions for ARM64 (implementation based on microsoft/STL#2127). Godbolt output here: https://godbolt.org/z/q7GPTqT14
2023-12-08Merge pull request #1496 from rouault/fix_1480Even Rouault
opj_tcd_dc_level_shift_decode(): avoid increment nullptr (fixes #1480)
2023-12-08Merge pull request #1490 from headshog/fix-j2kEven Rouault
Integer Overflow at j2k.c:3962
2023-12-08Merge pull request #1491 from headshog/fix-j2k-headerEven Rouault
Integer Overflow at j2k.c:11114
2023-12-08Merge pull request #1492 from headshog/fix-ht-decEven Rouault
fix ht_dec.c:1215
2023-12-08opj_tcd_dc_level_shift_decode(): avoid increment nullptr (fixes #1480)Even Rouault
(likely harmless issue as we don't dereference it)
2023-12-08Merge pull request #1484 from mayeut/mandatory-inttypes-stdintEven Rouault
Require `stdint.h` & `inttypes.h`
2023-12-08opj_t1_ht_decode_cblk(): avoid memcpy() with 0-input size and nullptr ↵headshog
destination. fix ht_dec.c:1215 (#1492)
2023-12-08fix j2k.c:11114headshog
2023-12-08opj_j2k_merge_ppm(): avoid unsigned-integer-overflow at j2k.c:3962 (#1490)headshog
2023-12-08suppress warning during build using clangTomoaki Teshima
2023-09-24Require `stdint.h` & `inttypes.h`mayeut
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.
2023-09-23fix: use `opj_uint_ceildiv` instead of `opj_int_ceildiv` when necessarymayeut
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
2023-03-26Merge pull request #1463 from rouault/fix_570Even Rouault
opj_jp2_read_header(): move setting color_space here instead in opj_jp2_decode()/get_tile() (fixes #570)
2023-03-26opj_jp2_read_header(): move setting icc_profile here instead in ↵Even Rouault
opj_jp2_decode()/get_tile() + add unit test (fixes #570)