Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package jasper for openSUSE:Factory checked 
in at 2022-06-04 23:26:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jasper (Old)
 and      /work/SRC/openSUSE:Factory/.jasper.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "jasper"

Sat Jun  4 23:26:47 2022 rev:18 rq:980633 version:3.0.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/jasper/jasper.changes    2022-03-16 
20:22:04.441039646 +0100
+++ /work/SRC/openSUSE:Factory/.jasper.new.1548/jasper.changes  2022-06-04 
23:26:48.868742388 +0200
@@ -1,0 +2,9 @@
+Fri Jun  3 12:41:24 UTC 2022 - Michael Vetter <mvet...@suse.com>
+
+- Update to 3.0.4:
+  * Eliminate some bogus calls to abort.
+  * Fix a typo in jas_safeui64_div (#323).
+  * Add some additional logging messages.
+  * Fix the source of a potential compiler warning (#321).
+
+-------------------------------------------------------------------

Old:
----
  version-3.0.3.tar.gz

New:
----
  version-3.0.4.tar.gz

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

Other differences:
------------------
++++++ jasper.spec ++++++
--- /var/tmp/diff_new_pack.n2LYOH/_old  2022-06-04 23:26:49.700743227 +0200
+++ /var/tmp/diff_new_pack.n2LYOH/_new  2022-06-04 23:26:49.704743232 +0200
@@ -20,7 +20,7 @@
 %global __builddir obs_build
 
 Name:           jasper
-Version:        3.0.3
+Version:        3.0.4
 Release:        0
 Summary:        An Implementation of the JPEG-2000 Standard, Part 1
 License:        JasPer-2.0

++++++ version-3.0.3.tar.gz -> version-3.0.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/.travis.yml 
new/jasper-version-3.0.4/.travis.yml
--- old/jasper-version-3.0.3/.travis.yml        2022-03-15 08:45:37.000000000 
+0100
+++ new/jasper-version-3.0.4/.travis.yml        1970-01-01 01:00:00.000000000 
+0100
@@ -1,79 +0,0 @@
-# NOTE: Do not perform Windows builds (at least for now) since this
-# feature is only in beta release and apparently secret environment
-# variables might not always be masked.  (At least some warnings
-# observed suggest this.)
-
-################################################################################
-# Specify notifications.
-################################################################################
-
-notifications:
-  email:
-    on_success: change
-    on_failure: always
-
-################################################################################
-# Specify the build matrix.
-################################################################################
-
-language: c
-
-os:
-  - linux
-  - osx
-
-# Trusty Tahr release date: April 17, 2014
-dist: trusty
-sudo: required
-
-compiler:
-  - clang
-  - gcc
-
-arch:
-  - amd64
-  - arm64
-  - ppc64le
-
-################################################################################
-# Specify extra packages needed.
-################################################################################
-
-addons:
-  apt:
-    packages:
-      - doxygen
-      - freeglut3-dev
-      - freeglut3
-      - libjpeg-turbo8
-      - libjpeg-turbo8-dev
-
-################################################################################
-# Specify build script.
-################################################################################
-
-script:
-  - build/travis/build -t /tmp/jasper
-
-################################################################################
-# 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/CMakeLists.txt 
new/jasper-version-3.0.4/CMakeLists.txt
--- old/jasper-version-3.0.3/CMakeLists.txt     2022-03-15 08:45:37.000000000 
+0100
+++ new/jasper-version-3.0.4/CMakeLists.txt     2022-06-03 06:10:20.000000000 
+0200
@@ -10,7 +10,7 @@
 # The major, minor, and micro version numbers of the project.
 set(JAS_VERSION_MAJOR 3)
 set(JAS_VERSION_MINOR 0)
-set(JAS_VERSION_PATCH 3)
+set(JAS_VERSION_PATCH 4)
 
 # The shared library versioning information.
 # Guidelines on how to change this information can be found below.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/NEWS.txt 
new/jasper-version-3.0.4/NEWS.txt
--- old/jasper-version-3.0.3/NEWS.txt   2022-03-15 08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/NEWS.txt   2022-06-03 06:10:20.000000000 +0200
@@ -1,3 +1,11 @@
+3.0.4 (2022-06-02)
+==================
+
+* Eliminate some bogus calls to abort.
+* Fix a typo in jas_safeui64_div (#323).
+* Add some additional logging messages.
+* Fix the source of a potential compiler warning (#321).
+
 3.0.3 (2022-03-15)
 ==================
 
Binary files old/jasper-version-3.0.3/data/test/other/pr325-bad-icc-profile.jp2 
and new/jasper-version-3.0.4/data/test/other/pr325-bad-icc-profile.jp2 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/src/libjasper/base/jas_cm.c 
new/jasper-version-3.0.4/src/libjasper/base/jas_cm.c
--- old/jasper-version-3.0.3/src/libjasper/base/jas_cm.c        2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/base/jas_cm.c        2022-06-03 
06:10:20.000000000 +0200
@@ -145,7 +145,7 @@
 
 #define gampxformseq(prof)     ((prof)->pxformseqs[SEQGAM])
 
-static jas_clrspc_t icctoclrspc(jas_iccsig_t iccclrspc, int refflag);
+static int icctoclrspc(jas_iccsig_t iccclrspc, jas_clrspc_t* clrspc, int 
refflag);
 static jas_cmpxform_t *jas_cmpxform_create0(void);
 static jas_cmpxform_t *jas_cmpxform_createshapmat(void);
 static void jas_cmshapmatlut_init(jas_cmshapmatlut_t *lut);
@@ -168,6 +168,8 @@
 
 jas_cmprof_t *jas_cmprof_createfromclrspc(jas_clrspc_t clrspc)
 {
+       JAS_LOGDEBUGF(1, "jas_cmprof_createfromclrspc(%d)\n", clrspc);
+
        jas_iccprof_t *iccprof;
        jas_cmprof_t *prof;
 
@@ -203,6 +205,8 @@
 
 static jas_cmprof_t *jas_cmprof_createsycc()
 {
+       JAS_LOGDEBUGF(1, "jas_cmprof_createsycc()\n");
+
        jas_cmprof_t *prof = 0;
        jas_cmpxform_t *fwdpxform = 0;
        jas_cmpxform_t *revpxform = 0;
@@ -286,6 +290,8 @@
 
 jas_cmprof_t *jas_cmprof_createfromiccprof(const jas_iccprof_t *iccprof)
 {
+       JAS_LOGDEBUGF(1, "jas_cmprof_createfromiccprof(%p)\n", iccprof);
+
        jas_cmprof_t *prof;
        jas_icchdr_t icchdr;
        jas_cmpxformseq_t *fwdpxformseq;
@@ -304,8 +310,14 @@
                jas_logerrorf("error: cannot copy ICC profile\n");
                goto error;
        }
-       prof->clrspc = icctoclrspc(icchdr.colorspc, 0);
-       prof->refclrspc = icctoclrspc(icchdr.refcolorspc, 1);
+       if (icctoclrspc(icchdr.colorspc, &prof->clrspc, 0)) {
+               jas_logerrorf("error: unknown color profile\n");
+               goto error;
+       }
+       if (icctoclrspc(icchdr.refcolorspc, &prof->refclrspc, 1)) {
+               jas_logerrorf("error: unknown reference color profile\n");
+               goto error;
+       }
        prof->numchans = jas_clrspc_numchans(prof->clrspc);
        prof->numrefchans = jas_clrspc_numchans(prof->refclrspc);
 
@@ -721,11 +733,16 @@
 static int jas_cmpxformseq_appendcnvt(jas_cmpxformseq_t *pxformseq,
   unsigned dstclrspc, unsigned srcclrspc)
 {
+       JAS_UNUSED(pxformseq);
        if (dstclrspc == srcclrspc) {
                return 0;
        }
+       /*
+       I think that this function should not be called if the source and
+       destination color spaces are of different types.
+       That is, it is considered a programmer error, not a run-time error.
+       */
        abort();
-       JAS_UNUSED(pxformseq);
        return -1;
 }
 
@@ -1092,11 +1109,9 @@
        d = in[0][0] * (in[1][1] * in[2][2] - in[1][2] * in[2][1])
          - in[0][1] * (in[1][0] * in[2][2] - in[1][2] * in[2][0])
          + in[0][2] * (in[1][0] * in[2][1] - in[1][1] * in[2][0]);
-#if 0
-       jas_eprintf("delta=%f\n", d);
-#endif
        if (JAS_ABS(d) < 1e-6) {
-               jas_logerrorf("jas_cmshapmat_invmat: matrix is not 
invertible\n");
+               jas_logerrorf("jas_cmshapmat_invmat: matrix is not invertible "
+                 "(determinant %a)\n", d);
                return -1;
        }
        out[0][0] = (in[1][1] * in[2][2] - in[1][2] * in[2][1]) / d;
@@ -1128,27 +1143,32 @@
 *
 
\******************************************************************************/
 
-static jas_clrspc_t icctoclrspc(jas_iccsig_t iccclrspc, int refflag)
+static int icctoclrspc(jas_iccsig_t iccclrspc, jas_clrspc_t* clrspc, int 
refflag)
 {
        if (refflag) {
                switch (iccclrspc) {
                case JAS_ICC_COLORSPC_XYZ:
-                       return JAS_CLRSPC_CIEXYZ;
+                       *clrspc = JAS_CLRSPC_CIEXYZ;
+                       return 0;
                case JAS_ICC_COLORSPC_LAB:
-                       return JAS_CLRSPC_CIELAB;
+                       *clrspc = JAS_CLRSPC_CIELAB;
+                       return 0;
                default:
-                       abort();
+                       return -1;
                }
        } else {
                switch (iccclrspc) {
                case JAS_ICC_COLORSPC_YCBCR:
-                       return JAS_CLRSPC_GENYCBCR;
+                       *clrspc = JAS_CLRSPC_GENYCBCR;
+                       return 0;
                case JAS_ICC_COLORSPC_RGB:
-                       return JAS_CLRSPC_GENRGB;
+                       *clrspc = JAS_CLRSPC_GENRGB;
+                       return 0;
                case JAS_ICC_COLORSPC_GRAY:
-                       return JAS_CLRSPC_GENGRAY;
+                       *clrspc = JAS_CLRSPC_GENGRAY;
+                       return 0;
                default:
-                       abort();
+                       return -1;
                }
        }
 }
@@ -1284,8 +1304,9 @@
                        shapmat->mat[1][i] = (jas_cmreal_t)cols[i]->data.xyz.y 
/ 65536.0;
                        shapmat->mat[2][i] = (jas_cmreal_t)cols[i]->data.xyz.z 
/ 65536.0;
                }
-               for (unsigned i = 0; i < 3; ++i)
+               for (unsigned i = 0; i < 3; ++i) {
                        shapmat->mat[i][3] = 0.0;
+               }
                for (unsigned i = 0; i < 3; ++i) {
                        if (jas_cmshapmatlut_set(&shapmat->luts[i], 
&trcs[i]->data.curv)) {
                                jas_logerrorf("error: jas_cmshapmatlut_set 
failed\n");
@@ -1299,8 +1320,9 @@
                        mat[1][i] = (jas_cmreal_t)cols[i]->data.xyz.y / 65536.0;
                        mat[2][i] = (jas_cmreal_t)cols[i]->data.xyz.z / 65536.0;
                }
-               for (unsigned i = 0; i < 3; ++i)
+               for (unsigned i = 0; i < 3; ++i) {
                        mat[i][3] = 0.0;
+               }
                if (jas_cmshapmat_invmat(shapmat->mat, mat)) {
                        jas_logerrorf("error: jas_cmshapmat_invmat failed\n");
                        goto error;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/src/libjasper/base/jas_image.c 
new/jasper-version-3.0.4/src/libjasper/base/jas_image.c
--- old/jasper-version-3.0.3/src/libjasper/base/jas_image.c     2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/base/jas_image.c     2022-06-03 
06:10:20.000000000 +0200
@@ -861,7 +861,7 @@
          ++fmtinfo) {
                if (fmtinfo->enabled && fmtinfo->ops.validate) {
                        /* Is the input data valid for this format? */
-                       JAS_LOGDEBUGF(20, "testing for format %s ... ", 
fmtinfo->name);
+                       JAS_LOGDEBUGF(20, "testing for format %s\n", 
fmtinfo->name);
                        if (!(*fmtinfo->ops.validate)(in)) {
                                JAS_LOGDEBUGF(20, "test succeeded\n");
                                return fmtinfo->id;
@@ -1597,7 +1597,7 @@
                continuing would crash because we'd attempt to
                obtain information about the first component
                */
-               return NULL;
+               return 0;
        }
 
        outimage = 0;
@@ -1640,7 +1640,8 @@
        const unsigned vstep = jas_image_cmptvstep(inimage, 0);
 
        if (!(inprof = jas_image_cmprof(inimage))) {
-               abort();
+               // formerly call to abort()
+               goto error;
        }
        const unsigned numinclrchans =
          jas_clrspc_numchans(jas_cmprof_clrspc(inprof));
@@ -1662,8 +1663,9 @@
                cmptparm.height = height;
                cmptparm.prec = prec;
                cmptparm.sgnd = 0;
-               if (jas_image_addcmpt(outimage, -1, &cmptparm))
+               if (jas_image_addcmpt(outimage, -1, &cmptparm)) {
                        goto error;
+               }
                jas_image_setcmpttype(outimage, i, JAS_IMAGE_CT_COLOR(i));
        }
 #if 0
@@ -1691,7 +1693,8 @@
 
        inpixmap.numcmpts = numinclrchans;
        if (!(incmptfmts = jas_alloc2(numinclrchans, sizeof(jas_cmcmptfmt_t)))) 
{
-               abort();
+               // formerly call to abort()
+               goto error;
        }
        inpixmap.cmptfmts = incmptfmts;
        for (unsigned i = 0; i < numinclrchans; ++i) {
@@ -1707,8 +1710,8 @@
 
        outpixmap.numcmpts = numoutclrchans;
        if (!(outcmptfmts = jas_alloc2(numoutclrchans, 
sizeof(jas_cmcmptfmt_t)))) {
-               /* TODO - return error instead of abort. */
-               abort();
+               // formerly call to abort()
+               goto error;
        }
        outpixmap.cmptfmts = outcmptfmts;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/src/libjasper/base/jas_stream.c 
new/jasper-version-3.0.4/src/libjasper/base/jas_stream.c
--- old/jasper-version-3.0.3/src/libjasper/base/jas_stream.c    2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/base/jas_stream.c    2022-06-03 
06:10:20.000000000 +0200
@@ -700,14 +700,15 @@
        return n;
 }
 
+/* TODO: The return type should probably be changed to size_t. */
 unsigned jas_stream_peek(jas_stream_t *stream, void *buf, size_t cnt)
 {
        char *bufptr = buf;
 
-       const unsigned n = jas_stream_read(stream, bufptr, cnt);
+       const size_t n = jas_stream_read(stream, bufptr, cnt);
 
        /* Put the characters read back onto the stream. */
-       for (unsigned i = n; i-- > 0;) {
+       for (size_t i = n; i-- > 0;) {
                if (jas_stream_ungetc(stream, bufptr[i]) == EOF) {
                        return 0;
                }
@@ -1165,7 +1166,6 @@
                m = JAS_MIN(n - i, 16);
                for (j = 0; j < m; ++j) {
                        if ((c = jas_stream_getc(stream)) == EOF) {
-                               abort();
                                return -1;
                        }
                        buf[j] = c;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/src/libjasper/bmp/bmp_cod.c 
new/jasper-version-3.0.4/src/libjasper/bmp/bmp_cod.c
--- old/jasper-version-3.0.3/src/libjasper/bmp/bmp_cod.c        2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/bmp/bmp_cod.c        2022-06-03 
06:10:20.000000000 +0200
@@ -126,8 +126,8 @@
                numcmpts = bmp_isgrayscalepal(info->palents, info->numcolors) ?
                  1 : 3;
        } else {
-               numcmpts = 0;
-               abort();
+               /* Cannot determine the number of components. */
+               numcmpts = -1;
        }
        return numcmpts;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/src/libjasper/bmp/bmp_dec.c 
new/jasper-version-3.0.4/src/libjasper/bmp/bmp_dec.c
--- old/jasper-version-3.0.3/src/libjasper/bmp/bmp_dec.c        2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/bmp/bmp_dec.c        2022-06-03 
06:10:20.000000000 +0200
@@ -240,7 +240,10 @@
        }
 
        /* Get the number of components. */
-       numcmpts = bmp_numcmpts(info);
+       if ((numcmpts = bmp_numcmpts(info)) < 0) {
+               jas_logerrorf("error: cannot determine number of components\n");
+               goto error;
+       }
 
        for (cmptno = 0, cmptparm = cmptparms; cmptno < numcmpts; ++cmptno,
          ++cmptparm) {
@@ -300,14 +303,20 @@
        assert(JAS_STREAM_MAXPUTBACK >= 2);
 
        /* Read the first two characters that constitute the signature. */
-       if (jas_stream_peek(in, buf, sizeof(buf)) != sizeof(buf))
+       if (jas_stream_peek(in, buf, sizeof(buf)) != sizeof(buf)) {
                return -1;
+       }
+
+       unsigned magic = (buf[0] | (buf[1] << 8));
 
        /* Is the signature correct for the BMP format? */
-       if (buf[0] == (BMP_MAGIC & 0xff) && buf[1] == (BMP_MAGIC >> 8)) {
-               return 0;
+       if (magic != BMP_MAGIC) {
+               JAS_LOGDEBUGF(20, "bad signature (0x%04lx != 0x%04lx)\n",
+                 JAS_CAST(unsigned long, magic),
+                 JAS_CAST(unsigned long, BMP_MAGIC));
+               return -1;
        }
-       return -1;
+       return 0;
 }
 
 
/******************************************************************************\
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jasper-version-3.0.3/src/libjasper/include/jasper/jas_math.h 
new/jasper-version-3.0.4/src/libjasper/include/jasper/jas_math.h
--- old/jasper-version-3.0.3/src/libjasper/include/jasper/jas_math.h    
2022-03-15 08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/include/jasper/jas_math.h    
2022-06-03 06:10:20.000000000 +0200
@@ -469,7 +469,7 @@
        jas_safeui64_t result;
        if (x.valid && y.valid && y.value) {
                result.valid = true;
-               result.value = x.value / y.valid;
+               result.value = x.value / y.value;
        } else {
                result.valid = false;
                result.value = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/src/libjasper/jp2/jp2_dec.c 
new/jasper-version-3.0.4/src/libjasper/jp2/jp2_dec.c
--- old/jasper-version-3.0.3/src/libjasper/jp2/jp2_dec.c        2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/jp2/jp2_dec.c        2022-06-03 
06:10:20.000000000 +0200
@@ -85,11 +85,6 @@
 #include <stdio.h>
 
 
/******************************************************************************\
-\******************************************************************************/
-
-#define        JP2_VALIDATELEN (JAS_MIN(JP2_JP_LEN + 16, 
JAS_STREAM_MAXPUTBACK))
-
-/******************************************************************************\
 * Function prototypes.
 
\******************************************************************************/
 
@@ -149,7 +144,9 @@
                goto error;
        }
        if (box->data.jp.magic != JP2_JP_MAGIC) {
-               jas_logerrorf("incorrect magic number\n");
+               jas_logerrorf("incorrect magic number (0x%lx != 0x%lx)\n",
+                 JAS_CAST(unsigned long, box->data.jp.magic),
+                 JAS_CAST(unsigned long, JP2_JP_MAGIC));
                goto error;
        }
        jp2_box_destroy(box);
@@ -320,12 +317,12 @@
                }
                jas_iccprof_gethdr(iccprof, &icchdr);
                jas_loginfof("ICC Profile CS %08x\n", icchdr.colorspc);
-               jas_image_setclrspc(dec->image, fromiccpcs(icchdr.colorspc));
                dec->image->cmprof_ = jas_cmprof_createfromiccprof(iccprof);
                if (!dec->image->cmprof_) {
-                       jas_iccprof_destroy(iccprof);
-                       jas_logerrorf("error: cannot create CM profile from ICC 
profile\n");
-                       goto error;
+                       jas_image_setclrspc(dec->image, JAS_CLRSPC_UNKNOWN);
+                       jas_logwarnf("warning: cannot create CM profile from 
ICC profile\n");
+               } else {
+                       jas_image_setclrspc(dec->image, 
fromiccpcs(icchdr.colorspc));
                }
                jas_iccprof_destroy(iccprof);
                break;
@@ -525,25 +522,25 @@
        return 0;
 }
 
+#define JP2_VALIDATE_LEN JAS_MIN(JP2_JP_LEN + 4, JAS_STREAM_MAXPUTBACK)
 int jp2_validate(jas_stream_t *in)
 {
-       unsigned char buf[JP2_VALIDATELEN];
-#if 0
-       jas_stream_t *tmpstream;
-       jp2_box_t *box;
-#endif
-
-       assert(JAS_STREAM_MAXPUTBACK >= JP2_VALIDATELEN);
+       unsigned char buf[JP2_VALIDATE_LEN];
 
        /* Read the validation data (i.e., the data used for detecting
          the format). */
-       if (jas_stream_peek(in, buf, sizeof(buf)) != sizeof(buf))
+       assert(sizeof(buf) <= JAS_STREAM_MAXPUTBACK);
+       if (jas_stream_peek(in, buf, sizeof(buf)) != sizeof(buf)) {
                return -1;
+       }
 
        /* Is the box type correct? */
-       if ((((uint_least32_t)buf[4] << 24) | ((uint_least32_t)buf[5] << 16) | 
((uint_least32_t)buf[6] << 8) | (uint_least32_t)buf[7]) !=
-         JP2_BOX_JP)
-       {
+       assert(JP2_VALIDATE_LEN >= 8);
+       if (((JAS_CAST(uint_least32_t, buf[4]) << 24) |
+         (JAS_CAST(uint_least32_t, buf[5]) << 16) |
+         (JAS_CAST(uint_least32_t, buf[6] << 8)) |
+         (JAS_CAST(uint_least32_t, buf[7]))) !=
+         JP2_BOX_JP) {
                return -1;
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/src/libjasper/pgx/pgx_dec.c 
new/jasper-version-3.0.4/src/libjasper/pgx/pgx_dec.c
--- old/jasper-version-3.0.3/src/libjasper/pgx/pgx_dec.c        2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/pgx/pgx_dec.c        2022-06-03 
06:10:20.000000000 +0200
@@ -245,6 +245,9 @@
 
        /* Ensure that the signature is correct for this format. */
        if (magic != PGX_MAGIC) {
+               JAS_LOGDEBUGF(20, "bad signature (0x%08lx != 0x%08lx)\n",
+                 JAS_CAST(unsigned long, magic),
+                 JAS_CAST(unsigned long, PGX_MAGIC));
                return -1;
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/src/libjasper/ras/ras_dec.c 
new/jasper-version-3.0.4/src/libjasper/ras/ras_dec.c
--- old/jasper-version-3.0.3/src/libjasper/ras/ras_dec.c        2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/src/libjasper/ras/ras_dec.c        2022-06-03 
06:10:20.000000000 +0200
@@ -271,8 +271,9 @@
 
        /* Read the validation data (i.e., the data used for detecting
          the format). */
-       if (jas_stream_peek(in, buf, sizeof(buf)) != sizeof(buf))
+       if (jas_stream_peek(in, buf, sizeof(buf)) != sizeof(buf)) {
                return -1;
+       }
 
        magic = (JAS_CAST(uint_fast32_t, buf[0]) << 24) |
          (JAS_CAST(uint_fast32_t, buf[1]) << 16) |
@@ -281,6 +282,9 @@
 
        /* Is the signature correct for the Sun Rasterfile format? */
        if (magic != RAS_MAGIC) {
+               JAS_LOGDEBUGF(20, "bad signature (0x%08lx != 0x%08lx)\n",
+                 JAS_CAST(unsigned long, magic),
+                 JAS_CAST(unsigned long, RAS_MAGIC));
                return -1;
        }
        return 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jasper-version-3.0.3/test/bin/run_test_imginfo 
new/jasper-version-3.0.4/test/bin/run_test_imginfo
--- old/jasper-version-3.0.3/test/bin/run_test_imginfo  2022-03-15 
08:45:37.000000000 +0100
+++ new/jasper-version-3.0.4/test/bin/run_test_imginfo  2022-06-03 
06:10:20.000000000 +0200
@@ -171,6 +171,7 @@
 test/good/105-PoC1.jp2 jp2 2 1 32 8 288
 test/good/109-PoC.jp2 jp2 1 32 32 4 512
 test/good/jasper-nullptr-jpc_pi_destroy.jp2 jpc 1 20 20 8 400
+test/other/pr325-bad-icc-profile.jp2 jp2 3 400 300 8 360000
 
 "
 

Reply via email to