diff -Nru charls-2.4.1/.github/workflows/build.yml charls-2.4.2/.github/workflows/build.yml --- charls-2.4.1/.github/workflows/build.yml 1970-01-01 00:00:00.000000000 +0000 +++ charls-2.4.2/.github/workflows/build.yml 2023-05-16 13:17:02.000000000 +0000 @@ -0,0 +1,36 @@ +name: SonarCloud Analysis +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: windows-latest + env: + BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Set up msbuild + uses: microsoft/setup-msbuild@v1.1 + + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@v1 + + - name: Run build-wrapper + run: | + build-wrapper-win-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} msbuild CharLS.sln /t:charls:rebuild /p:Configuration="Release" /p:Platform="x64" /nodeReuse:false + + - name: Run sonar-scanner + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here + run: | + sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" + diff -Nru charls-2.4.1/CHANGELOG.md charls-2.4.2/CHANGELOG.md --- charls-2.4.1/CHANGELOG.md 2023-01-02 16:20:36.000000000 +0000 +++ charls-2.4.2/CHANGELOG.md 2023-05-16 13:17:02.000000000 +0000 @@ -4,6 +4,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.4.2] - 2023-5-16 + +### Fixed + +- Fixed [#269](https://github.com/team-charls/charls/issues/269), Decoding doesn't work when compiled with mingw64. + ## [2.4.1] - 2023-1-2 ### Fixed @@ -21,7 +27,7 @@ ### Changed - Improved compatibility of public headers with C++20. -- Switch order of APP8 and SOF55 markers during encoding to allign with user application data markers. +- Switch order of APP8 and SOF55 markers during encoding to align with user application data markers. ### Fixed diff -Nru charls-2.4.1/README.md charls-2.4.2/README.md --- charls-2.4.1/README.md 2023-01-02 16:20:36.000000000 +0000 +++ charls-2.4.2/README.md 2023-05-16 13:17:02.000000000 +0000 @@ -6,6 +6,7 @@ [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://raw.githubusercontent.com/team-charls/charls/master/LICENSE.md) [![Build status](https://ci.appveyor.com/api/projects/status/yq0naf3v2m8nfa8r/branch/master?svg=true)](https://ci.appveyor.com/project/vbaderks/charls/branch/master) [![Build Status](https://dev.azure.com/team-charls/charls/_apis/build/status/team-charls.charls?branchName=master)](https://dev.azure.com/team-charls/charls/_build/latest?definitionId=2&branchName=master) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=team-charls_charls&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=team-charls_charls) [![Vcpkg package](https://repology.org/badge/version-for-repo/vcpkg/charls.svg)](https://repology.org/metapackage/charls) CharLS is a C++ implementation of the JPEG-LS standard for lossless and near-lossless image compression and decompression. diff -Nru charls-2.4.1/SECURITY.md charls-2.4.2/SECURITY.md --- charls-2.4.1/SECURITY.md 2023-01-02 16:20:36.000000000 +0000 +++ charls-2.4.2/SECURITY.md 2023-05-16 13:17:02.000000000 +0000 @@ -4,7 +4,8 @@ | Version | Supported | | ------- | ------------------ | -| 2.4.1 | :white_check_mark: | +| 2.4.2 | :white_check_mark: | +| 2.4.1 | :x: | | 2.4.0 | :x: | | 2.3.4 | :x: | | 2.3.3 | :x: | diff -Nru charls-2.4.1/debian/changelog charls-2.4.2/debian/changelog --- charls-2.4.1/debian/changelog 2023-09-19 05:34:10.000000000 +0000 +++ charls-2.4.2/debian/changelog 2024-03-06 17:32:08.000000000 +0000 @@ -1,9 +1,27 @@ -charls (2.4.1-1~20.04.sav0) focal; urgency=medium +charls (2.4.2-2~20.04.sav0) focal; urgency=medium * Backport to Focal * debian/control: Set debhelper-compat (= 12) BD - -- Rob Savoury Mon, 18 Sep 2023 22:34:10 -0700 + -- Rob Savoury Wed, 06 Mar 2024 09:32:08 -0800 + +charls (2.4.2-2) unstable; urgency=medium + + * Team upload. + * d/maintscript: Remove leftover + * d/rules: Migrate to ninja build + * d/control: Bump Std-Vers to 4.6.2 no changes needed + + -- Mathieu Malaterre Mon, 30 Oct 2023 15:56:47 +0100 + +charls (2.4.2-1) unstable; urgency=medium + + * Team upload. + * d/rules: Start using LTO + * New upstream version 2.4.2 + * d/rules: Remove old compat symlinks (oldstable) + + -- Mathieu Malaterre Thu, 12 Oct 2023 16:16:16 +0200 charls (2.4.1-1) unstable; urgency=medium diff -Nru charls-2.4.1/debian/control charls-2.4.2/debian/control --- charls-2.4.1/debian/control 2023-09-19 05:34:10.000000000 +0000 +++ charls-2.4.2/debian/control 2024-03-06 17:32:08.000000000 +0000 @@ -4,9 +4,8 @@ Shayan Doust Section: science Priority: optional -Build-Depends: cmake, - debhelper-compat (= 12) -Standards-Version: 4.6.1 +Build-Depends: cmake, debhelper-compat (= 12), ninja-build +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/med-team/charls Vcs-Git: https://salsa.debian.org/med-team/charls.git Homepage: https://github.com/team-charls/charls @@ -16,8 +15,7 @@ Architecture: any Multi-Arch: same Section: libdevel -Depends: libcharls2 (= ${binary:Version}), - ${misc:Depends} +Depends: libcharls2 (= ${binary:Version}), ${misc:Depends} Breaks: libdcmtk-dev (<< 3.6.5-1~) Replaces: libdcmtk-dev (<< 3.6.5-1~) Description: Implementation of the JPEG-LS standard (development libraries) @@ -36,8 +34,7 @@ Architecture: any Multi-Arch: same Section: libs -Depends: ${misc:Depends}, - ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Implementation of the JPEG-LS standard CharLS is an optimized implementation of the JPEG-LS standard for lossless and diff -Nru charls-2.4.1/debian/libcharls-dev.maintscript charls-2.4.2/debian/libcharls-dev.maintscript --- charls-2.4.1/debian/libcharls-dev.maintscript 2022-02-17 08:13:30.000000000 +0000 +++ charls-2.4.2/debian/libcharls-dev.maintscript 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -# See #971425, #971431 & #971435: -dir_to_symlink /usr/include/CharLS /usr/include/charls 2.1.0+dfsg-6~ libcharls-dev diff -Nru charls-2.4.1/debian/rules charls-2.4.2/debian/rules --- charls-2.4.1/debian/rules 2022-02-17 08:13:30.000000000 +0000 +++ charls-2.4.2/debian/rules 2023-10-30 14:55:35.000000000 +0000 @@ -3,7 +3,7 @@ include /usr/share/dpkg/default.mk -export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 # SAMPLES should not be installed: @@ -15,7 +15,7 @@ -DCHARLS_PEDANTIC_WARNINGS:BOOL=ON %: - dh $@ --buildsystem=cmake + dh $@ --buildsystem=cmake+ninja override_dh_auto_configure: dh_auto_configure -- $(CMAKE_EXTRA_FLAGS) @@ -34,13 +34,3 @@ dh_install -p$(pkg_dev) usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so dh_install -p$(pkg_dev) usr/lib/$(DEB_HOST_MULTIARCH)/cmake/charls/*.cmake dh_install -p$(pkg_dev) usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/charls.pc - # See #971425, #971431 & #971435: - dh_link -p$(pkg_run) usr/lib/$(DEB_HOST_MULTIARCH)/libcharls.so.2 usr/lib/$(DEB_HOST_MULTIARCH)/libCharLS.so.2 - dh_link -p$(pkg_dev) usr/lib/$(DEB_HOST_MULTIARCH)/libcharls.so usr/lib/$(DEB_HOST_MULTIARCH)/libCharLS.so - dh_link -p$(pkg_dev) usr/include/charls usr/include/CharLS -# dh_install -a -# d-shlibmove --commit \ -# --multiarch \ -# --devunversioned \ -# --movedev debian/tmp/usr/include/* usr/include \ -# debian/tmp/usr/lib/*/*.so diff -Nru charls-2.4.1/include/charls/version.h charls-2.4.2/include/charls/version.h --- charls-2.4.1/include/charls/version.h 2023-01-02 16:20:36.000000000 +0000 +++ charls-2.4.2/include/charls/version.h 2023-05-16 13:17:02.000000000 +0000 @@ -16,7 +16,7 @@ #define CHARLS_VERSION_MAJOR 2 #define CHARLS_VERSION_MINOR 4 -#define CHARLS_VERSION_PATCH 1 +#define CHARLS_VERSION_PATCH 2 /// /// Returns the version of CharLS in the semver format "major.minor.patch" or "major.minor.patch-pre_release" diff -Nru charls-2.4.1/sonar-project.properties charls-2.4.2/sonar-project.properties --- charls-2.4.1/sonar-project.properties 1970-01-01 00:00:00.000000000 +0000 +++ charls-2.4.2/sonar-project.properties 2023-05-16 13:17:02.000000000 +0000 @@ -0,0 +1,14 @@ +sonar.projectKey=team-charls_charls +sonar.organization=team-charls + +# This is the name and version displayed in the SonarCloud UI. +sonar.projectName=charls +sonar.projectVersion=2.4.1 + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +# sonar.sources=./src + +# Encoding of the source code. Default is default system encoding +sonar.sourceEncoding=UTF-8 + +sonar.cfamily.cache.enabled=false \ No newline at end of file diff -Nru charls-2.4.1/src/color_transform.h charls-2.4.2/src/color_transform.h --- charls-2.4.1/src/color_transform.h 2023-01-02 16:20:36.000000000 +0000 +++ charls-2.4.2/src/color_transform.h 2023-05-16 13:17:02.000000000 +0000 @@ -115,7 +115,7 @@ FORCE_INLINE triplet operator()(const int v1, const int v2, const int v3) const noexcept { - const int g = static_cast(v1 - ((v3 + v2) >> 2) + range_ / 4); + const auto g{static_cast(v1 - ((v3 + v2) >> 2) + range_ / 4)}; triplet rgb; rgb.R = static_cast(v3 + g - range_ / 2); // new R rgb.G = static_cast(g); // new G diff -Nru charls-2.4.1/src/context_regular_mode.h charls-2.4.2/src/context_regular_mode.h --- charls-2.4.1/src/context_regular_mode.h 2023-01-02 16:20:36.000000000 +0000 +++ charls-2.4.2/src/context_regular_mode.h 2023-05-16 13:17:02.000000000 +0000 @@ -98,6 +98,7 @@ int32_t k{}; for (; n_ << k < a_ && k < max_k_value; ++k) { + // Purpose of this loop is to calculate 'k', by design no content. } if (UNLIKELY(k == max_k_value)) diff -Nru charls-2.4.1/src/decoder_strategy.h charls-2.4.2/src/decoder_strategy.h --- charls-2.4.1/src/decoder_strategy.h 2023-01-02 16:20:36.000000000 +0000 +++ charls-2.4.2/src/decoder_strategy.h 2023-05-16 13:17:02.000000000 +0000 @@ -225,20 +225,18 @@ const cache_t new_byte_value{*position_}; - if (new_byte_value == jpeg_marker_start_byte) + // JPEG-LS bit stream rule: if FF is followed by a 1 bit then it is a marker + if (new_byte_value == jpeg_marker_start_byte && + (position_ == end_position_ - 1 || (position_[1] & 0x80) != 0)) { - // JPEG-LS bit stream rule: if FF is followed by a 1 bit then it is a marker - if (position_ == end_position_ - 1 || (position_[1] & 0x80) != 0) + if (UNLIKELY(valid_bits_ <= 0)) { - if (UNLIKELY(valid_bits_ <= 0)) - { - // Decoding process expects at least some bits to be added to the cache. - impl::throw_jpegls_error(jpegls_errc::invalid_encoded_data); - } - - // Marker detected, typical EOI, SOS (next scan) or RSTm. - return; + // Decoding process expects at least some bits to be added to the cache. + impl::throw_jpegls_error(jpegls_errc::invalid_encoded_data); } + + // End of buffer or marker detected. Typical found markers are EOI, SOS (next scan) or RSTm. + return; } read_cache_ |= new_byte_value << (max_readable_cache_bits - valid_bits_); diff -Nru charls-2.4.1/src/util.h charls-2.4.2/src/util.h --- charls-2.4.1/src/util.h 2023-01-02 16:20:36.000000000 +0000 +++ charls-2.4.2/src/util.h 2023-05-16 13:17:02.000000000 +0000 @@ -487,7 +487,7 @@ if (value == 0) return 64; - return __builtin_clzl(value); + return __builtin_clzll(value); } ///