Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package jasper for openSUSE:Factory checked 
in at 2021-08-18 08:55:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jasper (Old)
 and      /work/SRC/openSUSE:Factory/.jasper.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "jasper"

Wed Aug 18 08:55:45 2021 rev:11 rq:912351 version:2.0.33

Changes:
--------
--- /work/SRC/openSUSE:Factory/jasper/jasper.changes    2021-04-19 
21:06:54.148110609 +0200
+++ /work/SRC/openSUSE:Factory/.jasper.new.1899/jasper.changes  2021-08-18 
08:56:30.470932863 +0200
@@ -1,0 +2,7 @@
+Mon Aug 16 07:04:10 UTC 2021 - Michael Vetter <[email protected]>
+
+- Update to 2.0.33:
+  * Fix a JP2/JPC decoder bug (#291)
+  * Fix a build issue impacting some platforms (#296)
+
+-------------------------------------------------------------------

Old:
----
  version-2.0.32.tar.gz

New:
----
  version-2.0.33.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ jasper.spec ++++++
--- /var/tmp/diff_new_pack.1kHtTq/_old  2021-08-18 08:56:31.074932152 +0200
+++ /var/tmp/diff_new_pack.1kHtTq/_new  2021-08-18 08:56:31.078932148 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           jasper
-Version:        2.0.32
+Version:        2.0.33
 Release:        0
 Summary:        An Implementation of the JPEG-2000 Standard, Part 1
 License:        SUSE-Public-Domain

++++++ version-2.0.32.tar.gz -> version-2.0.33.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-2.0.32/.github/workflows/release.yml 
new/jasper-version-2.0.33/.github/workflows/release.yml
--- old/jasper-version-2.0.32/.github/workflows/release.yml     2021-04-19 
07:06:02.000000000 +0200
+++ new/jasper-version-2.0.33/.github/workflows/release.yml     2021-08-01 
22:50:31.000000000 +0200
@@ -4,20 +4,50 @@
   push:
     tags:
       - 'version-*.*.*'
+      - '!version-*.*.*-rc*'
+      - 'v*.*.*'
+      - '!v*.*.*-rc*'
+      - 'tmp-v*.*.*'
+      - '!tmp-v*.*.*-rc*'
 
 jobs:
   build:
     runs-on: ubuntu-latest
     steps:
+      ############################################################
       - name: Checkout
         uses: actions/checkout@v2
-      - name: Prepare
+        with:
+          fetch-depth: 0
+      ############################################################
+      - name: Prebuild
+        shell: bash
+        run: build/github/prebuild
+      ############################################################
+      - name: Build
+        shell: bash
         run: build/make_release -r ${{github.ref}} -w ${{github.workspace}} -t 
${{runner.temp}}/tmp -o ${{runner.temp}}/out
-      - name: Release
+      ############################################################
+      - name: Deploy Release
         uses: softprops/action-gh-release@v1
         with:
           files: |
-            ${{runner.temp}}/out/jasper.tar.gz
+            ${{runner.temp}}/out/jasper*.tar.gz
           body_path: ${{runner.temp}}/out/release_notes.txt
         env:
           GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+      ############################################################
+      - name: Deploy GitHub Pages Site for Manual
+        env:
+          DEPLOY_KEY: ${{secrets.MANUAL_DEPLOY_KEY}}
+        shell: bash
+        run: |
+          build/github/deploy_gh_pages \
+            -f \
+            -m key \
+            -t ${{runner.temp}}/deploy_gh_pages \
+            -i ${{runner.temp}}/out/doc \
+            -r jasper-software/jasper-manual \
+            -b gh-pages \
+            -z ${{github.ref}}
+      ############################################################
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-2.0.32/.travis.yml 
new/jasper-version-2.0.33/.travis.yml
--- old/jasper-version-2.0.32/.travis.yml       2021-04-19 07:06:02.000000000 
+0200
+++ new/jasper-version-2.0.33/.travis.yml       2021-08-01 22:50:31.000000000 
+0200
@@ -59,21 +59,21 @@
 # Specify deployment.
 
################################################################################
 
-jobs:
-  include:
-    - stage: deploy
-      script:
-        - build/travis/build -t /tmp/jasper
-      os: linux
-      dist: xenial
-      compiler: gcc
-      deploy:
-        provider: pages
-        repo: jasper-software/jasper-manual
-        target_branch: gh-pages
-        local_dir: /tmp/jasper/static/install/share/doc/JasPer/html
-        skip_cleanup: true
-        github_token: $GITHUB_TOKEN
-        keep_history: true
-        on:
-          branch: master
+#jobs:
+#  include:
+#    - stage: deploy
+#      script:
+#        - build/travis/build -t /tmp/jasper
+#      os: linux
+#      dist: xenial
+#      compiler: gcc
+#      deploy:
+#        provider: pages
+#        repo: jasper-software/jasper-manual
+#        target_branch: gh-pages
+#        local_dir: /tmp/jasper/static/install/share/doc/JasPer/html
+#        skip_cleanup: true
+#        github_token: $GITHUB_TOKEN
+#        keep_history: true
+#        on:
+#          branch: master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-2.0.32/CMakeLists.txt 
new/jasper-version-2.0.33/CMakeLists.txt
--- old/jasper-version-2.0.32/CMakeLists.txt    2021-04-19 07:06:02.000000000 
+0200
+++ new/jasper-version-2.0.33/CMakeLists.txt    2021-08-01 22:50:31.000000000 
+0200
@@ -17,7 +17,7 @@
 # The major, minor, and micro version numbers of the project.
 set(JAS_VERSION_MAJOR 2)
 set(JAS_VERSION_MINOR 0)
-set(JAS_VERSION_PATCH 32)
+set(JAS_VERSION_PATCH 33)
 
 # The project version.
 set(JAS_VERSION
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-2.0.32/NEWS 
new/jasper-version-2.0.33/NEWS
--- old/jasper-version-2.0.32/NEWS      2021-04-19 07:06:02.000000000 +0200
+++ new/jasper-version-2.0.33/NEWS      2021-08-01 22:50:31.000000000 +0200
@@ -1,3 +1,9 @@
+2.0.33 (2021-08-01)
+===================
+
+* Fix a JP2/JPC decoder bug.
+* Fix a build issue impacting some platforms.
+
 2.0.32 (2021-04-18)
 ===================
 
@@ -32,7 +38,7 @@
 ===================
 
 * Fix JP2 decoder bug that can cause a null pointer dereference for
-  some invalid CDEF boxes. (#268)
+  some invalid CDEF boxes. (#268) (CVE-2021-3467)
 
 2.0.25 (2021-02-07)
 ===================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-2.0.32/build/github/deploy_gh_pages 
new/jasper-version-2.0.33/build/github/deploy_gh_pages
--- old/jasper-version-2.0.32/build/github/deploy_gh_pages      1970-01-01 
01:00:00.000000000 +0100
+++ new/jasper-version-2.0.33/build/github/deploy_gh_pages      2021-08-01 
22:50:31.000000000 +0200
@@ -0,0 +1,326 @@
+#! /usr/bin/env bash
+
+# Copyright (c) 2021 Michael David Adams.
+# All rights reserved.
+
+################################################################################
+# Some helper functions.
+################################################################################
+
+# Terminate with error.
+panic()
+{
+       echo "ERROR: $@" 1>&2
+       exit 1
+}
+
+join_by()
+{
+       local IFS="$1"
+       shift
+       echo "$*"
+}
+
+
+# Print usage information and exit.
+usage()
+{
+       echo "bad usage: $@"
+       cat <<- EOF
+       $(basename $0) - deploy JasPer manual GitHub Pages site
+
+       Usage
+       =====
+
+       $0 [options]
+
+       Options
+       =======
+
+       -b \$branch
+           Set the deployment branch to \$branch.
+       -t \$tmp_dir
+           Set the temporary directory to $\tmp_dir.
+       -i \$in_dir
+           Set the input directory to \$in_dir.
+           This is the directory containing the output of the document build
+           process.
+       -r \$repo_name
+           Set the deployment repository to \$repo_name.
+           This includes both the user/organization and repository name.
+       -z \$github_ref
+           Set the GitHub ref to \$github_ref.
+       -f
+           Allow private key file to be overwritten.
+       -n
+           Prepare to push to deployment repository but do not actually
+           push the changes.  (This is only for testing purposes.)
+
+       Examples
+       ========
+
+       export DEPLOY_KEY=.... # set DEPLOY_KEY to private SSH key
+       $0 -n -f -r jasper-software/jasper -b gh-pages \\
+         -t /tmp/jasper_test/tmp -i /tmp/jasper_test/install -z 
refs/tags/v1.0.0
+       EOF
+       exit 2
+}
+
+################################################################################
+# Parse command line.
+################################################################################
+
+branch="gh-pages"
+in_dir=
+repo_name=
+tmp_dir="${TMPDIR:-/tmp}"
+github_ref=
+force=0
+prepare_only=0
+verbose=1
+deploy_mode=
+
+while getopts b:i:r:t:z:fnvqm: opt; do
+       case $opt in
+       m)
+               deploy_mode="$OPTARG";;
+       v)
+               verbose=$((verbose + 1));;
+       q)
+               verbose=$((verbose - 1));;
+       b)
+               branch="$OPTARG";;
+       t)
+               tmp_dir="$OPTARG";;
+       i)
+               in_dir="$OPTARG";;
+       r)
+               repo_name="$OPTARG";;
+       z)
+               github_ref="$OPTARG";;
+       f)
+               force=1;;
+       n)
+               prepare_only=1;;
+       \?)
+               usage
+               break;;
+       esac
+done
+shift $((OPTIND - 1))
+
+if [ -z "$github_ref" ]; then
+       usage "no github ref specified"
+fi
+if [ -z "$tmp_dir" ]; then
+       usage "no temporary directory specified"
+fi
+if [ -z "$in_dir" ]; then
+       usage "no input directory specified"
+fi
+if [ -z "$repo_name" ]; then
+       usage "no repository name specified"
+fi
+
+case "$deploy_mode" in
+key)
+       if [ -z "$DEPLOY_KEY" ]; then
+               usage "DEPLOY_KEY environment variable not set"
+       fi
+       ;;
+token)
+       if [ -z "$DEPLOY_TOKEN" ]; then
+               usage "DEPLOY_TOKEN environment variable not set"
+       fi
+       ;;
+*)
+       usage "bad deployment mode specified $deploy_mode"
+       ;;
+esac
+
+if [ "$verbose" -ge 1 ]; then
+       echo "temporary directory $tmp_dir"
+       echo "input directory $in_dir"
+       echo "repository name $repo_name"
+       echo "GitHub ref $github_ref"
+fi
+
+################################################################################
+# Perform some basic initialization.
+################################################################################
+
+if [ "$verbose" -ge 3 ]; then
+       set -xv
+fi
+
+cmd_dir=$(dirname "$0") || \
+  panic "cannot determine directory"
+top_dir="$cmd_dir/../.."
+
+version="$(awk -v FS="/" '{print $3;}' <<< "$github_ref")" || \
+  panic "cannot determine document version"
+if [ "$verbose" -ge 1 ]; then
+       echo "version $version"
+fi
+
+tmp_dir="$tmp_dir/deploy"
+
+git_dir="$tmp_dir/git"
+version_dir="$git_dir/$version"
+github_host="github.com"
+github_user="git"
+
+################################################################################
+# Setup SSH client configuration if needed.
+################################################################################
+
+case "$deploy_mode" in
+
+key)
+
+       ssh_dir="$HOME/.ssh"
+       private_key_file="$ssh_dir/private_key"
+
+       repo_url="ssh://git@$github_host/$repo_name.git"
+
+       if [ "$force" -eq 0 -a -e "$private_key_file" ]; then
+               panic "private key file already exists"
+       fi
+
+       if [ ! -d "$ssh_dir" ]; then
+               mkdir -p "$ssh_dir" || \
+                 panic "cannot make directory $ssh_dir"
+       fi
+       if [ ! -d "$tmp_dir" ]; then
+               mkdir -p "$ssh_dir" || \
+                 panic "cannot make directory $ssh_dir"
+       fi
+
+       echo "$DEPLOY_KEY" > "$private_key_file" || \
+         panic "cannot create private key file"
+       chmod u+rw,g=,o= "$private_key_file" || \
+         panic "cannot set permissions for private key file"
+
+       if [ -z "$SSH_AGENT_PID" ]; then
+               eval $(ssh-agent) || \
+                 panic "cannot start ssh-agent"
+       fi
+       ssh-add "$private_key_file" || \
+         panic "ssh-add failed"
+       ;;
+
+token)
+
+       git config --global credential.helper 'cache --timeout=86400' || \
+         panic "cannot set credential helper"
+       cred_info=()
+       cred_info+=("protocol=https")
+       cred_info+=("host=$github_host")
+       cred_info+=("username=$github_user")
+       cred_info+=("password=$DEPLOY_TOKEN")
+       cred_string="$(join_by $'\n' "${cred_info[@]}")" || \
+         panic "string processing failed"
+       cred_string="$(git credential fill <<< "$cred_string")" || \
+         panic "git credential fill failed"
+
+       git credential approve <<< "$cred_string" || \
+         panic "git credential approve failed"
+
+       repo_url="https://$github_user@$github_host/$repo_name.git";
+       ;;
+
+*)
+
+       panic "unexpected case"
+       ;;
+
+esac
+
+if [ "$verbose" -ge 1 ]; then
+       echo "repository URL: $repo_url"
+fi
+
+################################################################################
+# Add new release to GitHub pages repository.
+################################################################################
+
+git_push_extra_args=()
+
+# Clone the repository.
+git clone "$repo_url" "$git_dir" || \
+  panic "cannot clone repository $repo_url"
+
+# Create an orphaned branch for the web site content if the branch does
+# not already exist.
+git -C "$git_dir" ls-remote --exit-code --heads "$repo_url" "$branch" \
+  > /dev/null
+status=$?
+if [ "$status" -ne 0 -a "$status" -ne 2 ]; then
+       panic "git ls-remote failed"
+fi
+if [ "$status" -eq 2 ]; then
+       git -C "$git_dir" checkout --orphan "$branch" || \
+         panic "cannot create orphan branch $branch"
+       git_push_extra_args=(-u origin "$branch")
+else
+       git -C "$git_dir" checkout "$branch" || \
+         panic "cannot checkout branch $branch"
+fi
+
+# Set the Git user.
+git -C "$git_dir" config --local user.name "Michael Adams" || \
+  panic "cannot set Git user name"
+git -C "$git_dir" config --local user.email "[email protected]" || \
+  panic "cannot set Git user email"
+
+# Add the content for the new release.
+if [ -e "$version_dir" ]; then
+       panic "directory already exist for $version"
+fi
+mkdir -p "$version_dir" || \
+  panic "cannot make directory $version_dir"
+(cd "$in_dir" && tar -cf - .) | (cd "$version_dir" && tar -xf -) || \
+  panic "tar failed"
+
+# Update the symlink for the latest release.
+target="$git_dir/latest"
+if [ -h "$target" -o -e "$target" ]; then
+       rm -f "$target" || panic "rm failed"
+fi
+ln -s "$version/html" "$target" || \
+  panic "ln failed"
+
+index_html_data='
+<head>
+  <meta http-equiv="refresh" content="0; 
URL=https://jasper-software.github.io/jasper-manual/latest/"; />
+</head>
+<body>
+  <p>If you are not redirected in five seconds, <a 
href="https://jasper-software.github.io/jasper-manual/latest/";>click 
here</a>.</p>
+</body>
+'
+
+# Add a top-level index.html file to redirect to the latest release.
+target="$git_dir/index.html"
+if [ -e "$target" ]; then
+       rm -f "$target" || panic "cannot remove $target"
+fi
+cat > "$target" <<< "$index_html_data" || \
+  panic "cannot create index.html"
+#cp "$top_dir/sources/index.html" "$target" || panic "cannot copy $target"
+
+if [ "$verbose" -ge 2 ]; then
+       ls -al "$git_dir"/*
+fi
+
+# Commit and push all of the changes.
+git -C "$git_dir" add . || \
+  panic "git add failed"
+git -C "$git_dir" commit -m "Deploying release $version" || \
+  panic "git commit failed"
+if [ "$prepare_only" -eq 0 ]; then
+       if [ "$verbose" -ge 1 ]; then
+               echo "Pushing changes."
+       fi
+       git -C "$git_dir" push "${git_push_extra_args[@]}" || \
+         panic "git push failed"
+fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-2.0.32/build/github/prebuild 
new/jasper-version-2.0.33/build/github/prebuild
--- old/jasper-version-2.0.32/build/github/prebuild     1970-01-01 
01:00:00.000000000 +0100
+++ new/jasper-version-2.0.33/build/github/prebuild     2021-08-01 
22:50:31.000000000 +0200
@@ -0,0 +1,19 @@
+#! /usr/bin/env bash
+
+# Copyright (c) 2021 Michael David Adams.
+# All rights reserved.
+
+# Terminate with error.
+panic()
+{
+       echo "ERROR: $@" 1>&2
+       exit 1
+}
+
+# Initialize the list of required packages.
+packages=()
+packages+=(doxygen)
+
+# Install the packages.
+sudo apt-get install -y "${packages[@]}" || \
+  panic "unable to install packages"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-2.0.32/build/make_release 
new/jasper-version-2.0.33/build/make_release
--- old/jasper-version-2.0.32/build/make_release        2021-04-19 
07:06:02.000000000 +0200
+++ new/jasper-version-2.0.33/build/make_release        2021-08-01 
22:50:31.000000000 +0200
@@ -83,14 +83,15 @@
 news_file="$workspace_dir/NEWS"
 changelog_file="$source_dir/ChangeLog"
 release_notes_file="$out_dir/release_notes.txt"
-archive_file="$out_dir/jasper.tar.gz"
+archive_file="$out_dir/${name}.tar.gz"
 
 echo "name: $name"
 echo "commit: $commit"
 echo "tag: $tag"
 echo "version: $version"
 
-for dir in "$tmp_dir" "$out_dir" "$build_dir" "$source_dir" "$install_dir"; do
+for dir in "$tmp_dir" "$out_dir" "$build_dir" "$source_dir" "$install_dir" \
+  "$out_dir/doc/html"; do
        if [ ! -d "$dir" ]; then
                mkdir -p "$dir" || panic "cannot make directory $dir"
        fi
@@ -113,7 +114,7 @@
 cmake \
   -G "Unix Makefiles" \
   -DCMAKE_INSTALL_PREFIX="$install_dir" \
-  -DJAS_ENABLE_DOC=false \
+  -DJAS_ENABLE_DOC=true \
   -DJAS_ENABLE_OPENGL=false \
   -H"$source_dir" -B"$build_dir" || \
   panic "cmake failed"
@@ -121,8 +122,11 @@
 cmake --build "$build_dir" --clean-first || \
   panic "make clean/all failed"
 
-#mv "$build_dir/doc/html" "$source_dir/doc/html" || \
-#  panic "cannot move html"
+#cmake --build "$build_dir" --target install || \
+#  panic "make install failed"
+
+cp -a "$build_dir/doc/html/." "$out_dir/doc/html" || \
+  panic "cannot move html"
 
 #mv "$build_dir/doc/latex/refman.pdf" "$source_dir/doc/manual.pdf" || \
 #  panic "cannot move manual.pdf"
@@ -148,4 +152,3 @@
 
 tar -C "$tmp_dir" -czf - "$name" > "$archive_file" || \
   panic "cannot make archive"
-
Binary files old/jasper-version-2.0.32/data/test/bad/291.jp2 and 
new/jasper-version-2.0.33/data/test/bad/291.jp2 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-2.0.32/src/libjasper/base/jas_icc.c 
new/jasper-version-2.0.33/src/libjasper/base/jas_icc.c
--- old/jasper-version-2.0.32/src/libjasper/base/jas_icc.c      2021-04-19 
07:06:02.000000000 +0200
+++ new/jasper-version-2.0.33/src/libjasper/base/jas_icc.c      2021-08-01 
22:50:31.000000000 +0200
@@ -1018,8 +1018,10 @@
 static int jas_iccxyz_input(jas_iccattrval_t *attrval, jas_stream_t *in,
   unsigned len)
 {
-       assert(len == 4 * 3);
-       (void)len;
+       if (len != 4 * 3)
+       {
+               return -1;
+       }
        return jas_iccgetxyz(in, &attrval->data.xyz);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jasper-version-2.0.32/src/libjasper/include/jasper/jas_compiler.h 
new/jasper-version-2.0.33/src/libjasper/include/jasper/jas_compiler.h
--- old/jasper-version-2.0.32/src/libjasper/include/jasper/jas_compiler.h       
2021-04-19 07:06:02.000000000 +0200
+++ new/jasper-version-2.0.33/src/libjasper/include/jasper/jas_compiler.h       
2021-08-01 22:50:31.000000000 +0200
@@ -77,7 +77,11 @@
 #define JAS_ATTRIBUTE_CONST __attribute__((const))
 #define JAS_ATTRIBUTE_PURE __attribute__((pure))
 #define JAS_FORCE_INLINE inline __attribute__((always_inline))
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
 #define JAS_UNREACHABLE() __builtin_unreachable()
+#else
+#define JAS_UNREACHABLE()
+#endif
 #define JAS_LIKELY(x) __builtin_expect (!!(x), 1)
 #define JAS_UNLIKELY(x) __builtin_expect (!!(x), 0)
 #else
@@ -100,4 +104,10 @@
 #define JAS_ATTRIBUTE_DISABLE_USAN
 #endif
 
+#ifdef __has_builtin
+#define jas_has_builtin(x) __has_builtin(x)
+#else
+#define jas_has_builtin(x) 0
+#endif
+
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jasper-version-2.0.32/src/libjasper/include/jasper/jas_math.h 
new/jasper-version-2.0.33/src/libjasper/include/jasper/jas_math.h
--- old/jasper-version-2.0.32/src/libjasper/include/jasper/jas_math.h   
2021-04-19 07:06:02.000000000 +0200
+++ new/jasper-version-2.0.33/src/libjasper/include/jasper/jas_math.h   
2021-08-01 22:50:31.000000000 +0200
@@ -76,6 +76,7 @@
 /* The configuration header file should be included first. */
 #include <jasper/jas_config.h>
 
+#include <jasper/jas_compiler.h>
 #include <jasper/jas_types.h>
 
 #include <assert.h>
@@ -216,7 +217,7 @@
 /* Compute the product of two size_t integers with overflow checking. */
 inline static bool jas_safe_size_mul(size_t x, size_t y, size_t *result)
 {
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 5)
+#if jas_has_builtin(__builtin_mul_overflow) || (defined(__GNUC__) && __GNUC__ 
> 5)
        size_t result_buffer;
        if (!result)
                result = &result_buffer;
@@ -252,7 +253,7 @@
 /* Compute the sum of two size_t integers with overflow checking. */
 inline static bool jas_safe_size_add(size_t x, size_t y, size_t *result)
 {
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 5)
+#if jas_has_builtin(__builtin_add_overflow) || (defined(__GNUC__) && __GNUC__ 
> 5)
        size_t result_buffer;
        if (!result)
                result = &result_buffer;
@@ -271,7 +272,7 @@
 /* Compute the difference of two size_t integers with overflow checking. */
 inline static bool jas_safe_size_sub(size_t x, size_t y, size_t *result)
 {
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 5)
+#if jas_has_builtin(__builtin_sub_overflow) || (defined(__GNUC__) && __GNUC__ 
> 5)
        size_t result_buffer;
        if (!result)
                result = &result_buffer;
@@ -291,7 +292,7 @@
 inline static bool jas_safe_intfast32_mul(int_fast32_t x, int_fast32_t y,
   int_fast32_t *result)
 {
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 5)
+#if jas_has_builtin(__builtin_mul_overflow) || (defined(__GNUC__) && __GNUC__ 
> 5)
        int_fast32_t result_buffer;
        if (!result)
                result = &result_buffer;
@@ -350,7 +351,7 @@
 inline static bool jas_safe_intfast32_add(int_fast32_t x, int_fast32_t y,
   int_fast32_t *result)
 {
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 5)
+#if jas_has_builtin(__builtin_add_overflow) || (defined(__GNUC__) && __GNUC__ 
> 5)
        int_fast32_t result_buffer;
        if (!result)
                result = &result_buffer;

Reply via email to