[med-svn] [Git][med-team/charls][upstream] New upstream version 2.4.2

Mathieu Malaterre (@malat) gitlab at salsa.debian.org
Thu Oct 12 15:17:55 BST 2023



Mathieu Malaterre pushed to branch upstream at Debian Med / charls


Commits:
80d1ed66 by Mathieu Malaterre at 2023-10-12T16:12:25+02:00
New upstream version 2.4.2
- - - - -


10 changed files:

- + .github/workflows/build.yml
- CHANGELOG.md
- README.md
- SECURITY.md
- include/charls/version.h
- + sonar-project.properties
- src/color_transform.h
- src/context_regular_mode.h
- src/decoder_strategy.h
- src/util.h


Changes:

=====================================
.github/workflows/build.yml
=====================================
@@ -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 at v3
+        with:
+          fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+
+      - name: Set up msbuild
+        uses: microsoft/setup-msbuild at v1.1
+
+      - name: Install sonar-scanner and build-wrapper
+        uses: SonarSource/sonarcloud-github-c-cpp at 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 }}"
+


=====================================
CHANGELOG.md
=====================================
@@ -4,6 +4,12 @@ All notable changes to this project are documented in this file.
 
 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 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
 ### 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
 


=====================================
README.md
=====================================
@@ -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.


=====================================
SECURITY.md
=====================================
@@ -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:                |


=====================================
include/charls/version.h
=====================================
@@ -16,7 +16,7 @@ extern "C" {
 
 #define CHARLS_VERSION_MAJOR 2
 #define CHARLS_VERSION_MINOR 4
-#define CHARLS_VERSION_PATCH 1
+#define CHARLS_VERSION_PATCH 2
 
 /// <summary>
 /// Returns the version of CharLS in the semver format "major.minor.patch" or "major.minor.patch-pre_release"


=====================================
sonar-project.properties
=====================================
@@ -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


=====================================
src/color_transform.h
=====================================
@@ -115,7 +115,7 @@ struct transform_hp3 final
 
         FORCE_INLINE triplet<T> operator()(const int v1, const int v2, const int v3) const noexcept
         {
-            const int g = static_cast<int>(v1 - ((v3 + v2) >> 2) + range_ / 4);
+            const auto g{static_cast<int>(v1 - ((v3 + v2) >> 2) + range_ / 4)};
             triplet<T> rgb;
             rgb.R = static_cast<T>(v3 + g - range_ / 2); // new R
             rgb.G = static_cast<T>(g);                   // new G


=====================================
src/context_regular_mode.h
=====================================
@@ -98,6 +98,7 @@ public:
         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))


=====================================
src/decoder_strategy.h
=====================================
@@ -225,20 +225,18 @@ private:
 
             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_);


=====================================
src/util.h
=====================================
@@ -487,7 +487,7 @@ auto countl_zero(const T value) noexcept -> std::enable_if_t<is_uint_v<64, T>, i
     if (value == 0)
         return 64;
 
-    return __builtin_clzl(value);
+    return __builtin_clzll(value);
 }
 
 /// <summary>



View it on GitLab: https://salsa.debian.org/med-team/charls/-/commit/80d1ed663476cfd730f68aaaa802ef42627ef237

-- 
View it on GitLab: https://salsa.debian.org/med-team/charls/-/commit/80d1ed663476cfd730f68aaaa802ef42627ef237
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20231012/12f42c48/attachment-0001.htm>


More information about the debian-med-commit mailing list