Hello community,

here is the log from the commit of package jasper for openSUSE:Factory checked 
in at 2017-03-18 20:49:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jasper (Old)
 and      /work/SRC/openSUSE:Factory/.jasper.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "jasper"

Sat Mar 18 20:49:34 2017 rev:37 rq:480785 version:1.900.14

Changes:
--------
--- /work/SRC/openSUSE:Factory/jasper/jasper.changes    2017-03-10 
21:00:27.344275359 +0100
+++ /work/SRC/openSUSE:Factory/.jasper.new/jasper.changes       2017-03-18 
20:49:35.542022975 +0100
@@ -1,0 +2,20 @@
+Fri Mar 17 08:25:35 UTC 2017 - [email protected]
+
+- Added patches:
+  * jasper-CVE-2017-5498.patch
+    - Upstream changes putting braces and belts around
+      CVE-2017-5498, bsc#1020353, left-shift undefined behaviour
+  * jasper-CVE-2016-9600.patch
+    - Upstream fix for "Null Pointer Dereference due to missing
+      check for UNKNOWN color space in JP2 encoder" (CVE-2016-9600,
+      bsc#1018088)
+
+-------------------------------------------------------------------
+Thu Mar 16 08:28:31 UTC 2017 - [email protected]
+
+- Added patch:
+  * jasper-CVE-2016-10251.patch
+    - Upstream fix for bsc#1029497, CVE-2016-10251: Use of
+      uninitialized value in jpc_pi_nextcprl (jpc_t2cod.c)
+
+-------------------------------------------------------------------

New:
----
  jasper-CVE-2016-10251.patch
  jasper-CVE-2016-9600.patch
  jasper-CVE-2017-5498.patch

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

Other differences:
------------------
++++++ jasper.spec ++++++
--- /var/tmp/diff_new_pack.wuSCfv/_old  2017-03-18 20:49:36.321912490 +0100
+++ /var/tmp/diff_new_pack.wuSCfv/_new  2017-03-18 20:49:36.321912490 +0100
@@ -17,16 +17,12 @@
 
 
 Name:           jasper
-BuildRequires:  gcc-c++
-BuildRequires:  libdrm-devel
-BuildRequires:  libjpeg-devel
-BuildRequires:  unzip
-Url:            http://www.ece.uvic.ca/~mdadams/jasper/
 Version:        1.900.14
 Release:        0
 Summary:        An Implementation of the JPEG-2000 Standard, Part 1
 License:        SUSE-Public-Domain
 Group:          Productivity/Graphics/Convertors
+Url:            http://www.ece.uvic.ca/~mdadams/jasper/
 Source:         %{name}-%{version}.tar.bz2
 Source2:        baselibs.conf
 Patch0:         jasper-1.900.1-uninitialized.patch
@@ -35,7 +31,17 @@
 Patch3:         jasper-CVE-2016-9398.patch
 Patch4:         jasper-CVE-2016-9560.patch
 Patch5:         jasper-CVE-2016-9591.patch
-
+Patch6:         jasper-CVE-2016-10251.patch
+Patch7:         jasper-CVE-2017-5498.patch
+Patch8:         jasper-CVE-2016-9600.patch
+BuildRequires:  autoconf
+BuildRequires:  automake
+BuildRequires:  gcc-c++
+BuildRequires:  libdrm-devel
+BuildRequires:  libjpeg-devel
+BuildRequires:  libtool
+BuildRequires:  pkgconfig
+BuildRequires:  unzip
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -46,13 +52,13 @@
 %package -n libjasper1
 Summary:        JPEG-2000 library
 # bug437293
+# used in <= 11.3
 Group:          Productivity/Graphics/Convertors
+Obsoletes:      libjasper < %{version}-%{release}
+Provides:       libjasper = %{version}-%{release}
 %ifarch ppc64
 Obsoletes:      libjasper-64bit
 %endif
-# used in <= 11.3
-Obsoletes:      libjasper < %{version}-%{release}
-Provides:       libjasper = %{version}-%{release}
 #
 
 %description -n libjasper1
@@ -62,13 +68,13 @@
 %package -n libjasper-devel
 Summary:        Development files for libjasper, a JPEG-2000 library
 # bug437293
+#
 Group:          Development/Libraries/C and C++
+Requires:       libjasper1 = %{version}
+Requires:       libjpeg-devel
 %ifarch ppc64
 Obsoletes:      libjasper-devel-64bit
 %endif
-#
-Requires:       libjasper1 = %{version}
-Requires:       libjpeg-devel
 
 %description -n libjasper-devel
 This package contains libjasper, a library implementing the JPEG-2000
@@ -82,9 +88,14 @@
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
 
 %build
-export CFLAGS="$RPM_OPT_FLAGS -Wall -std=c99 -D_BSD_SOURCE"
+libtoolize --force --copy --install
+autoreconf -fi
+export CFLAGS="%{optflags} -Wall -std=c99 -D_BSD_SOURCE"
 %configure --prefix="%{_prefix}" --enable-shared --disable-static 
--libdir=%{_libdir}
 make %{?_smp_mflags}
 #
@@ -98,22 +109,21 @@
 fi
 
 %install
-make install DESTDIR=$RPM_BUILD_ROOT
+%make_install
 mv doc/README doc/README.doc
-rm $RPM_BUILD_ROOT/usr/bin/tmrdemo
+rm %{buildroot}%{_bindir}/tmrdemo
 # compatibility link, there was no interface change
-ln -s libjasper.so.1.0.0 $RPM_BUILD_ROOT%{_libdir}/libjasper-1.701.so.1
+ln -s libjasper.so.1.0.0 %{buildroot}%{_libdir}/libjasper-1.701.so.1
 
 %post -n libjasper1 -p /sbin/ldconfig
-
 %postun -n libjasper1 -p /sbin/ldconfig
 
 %files
 %defattr(-,root,root)
-%doc COPYRIGHT INSTALL LICENSE NEWS README doc/*
-/usr/bin/imgcmp
-/usr/bin/imginfo
-/usr/bin/jasper
+%doc COPYRIGHT LICENSE NEWS README doc/*
+%{_bindir}/imgcmp
+%{_bindir}/imginfo
+%{_bindir}/jasper
 %{_mandir}/man*/*
 
 %files -n libjasper1
@@ -122,7 +132,7 @@
 
 %files -n libjasper-devel
 %defattr(-,root,root)
-/usr/include/jasper
+%{_includedir}/jasper
 %{_libdir}/libjasper.so
 %{_libdir}/libjasper.la
 %{_libdir}/pkgconfig/jasper.pc

++++++ jasper-CVE-2016-10251.patch ++++++
--- jasper-1.900.14/src/libjasper/jpc/jpc_t2cod.c       2017-03-16 
09:23:44.445202359 +0100
+++ jasper-1.900.14/src/libjasper/jpc/jpc_t2cod.c       2017-03-16 
09:25:00.433202141 +0100
@@ -432,18 +432,18 @@
          &pi->picomps[pi->compno]; pi->compno < JAS_CAST(int, pchg->compnoend) 
&& pi->compno < pi->numcomps; ++pi->compno,
          ++pi->picomp) {
                pirlvl = pi->picomp->pirlvls;
-               pi->xstep = pi->picomp->hsamp * (1 << (pirlvl->prcwidthexpn +
-                 pi->picomp->numrlvls - 1));
-               pi->ystep = pi->picomp->vsamp * (1 << (pirlvl->prcheightexpn +
-                 pi->picomp->numrlvls - 1));
+               pi->xstep = pi->picomp->hsamp * (JAS_CAST(uint_fast32_t, 1) <<
+                 (pirlvl->prcwidthexpn + pi->picomp->numrlvls - 1));
+               pi->ystep = pi->picomp->vsamp * (JAS_CAST(uint_fast32_t, 1) <<
+                 (pirlvl->prcheightexpn + pi->picomp->numrlvls - 1));
                for (rlvlno = 1, pirlvl = &pi->picomp->pirlvls[1];
                  rlvlno < pi->picomp->numrlvls; ++rlvlno, ++pirlvl) {
-                       pi->xstep = JAS_MIN(pi->xstep, pi->picomp->hsamp * (1 <<
-                         (pirlvl->prcwidthexpn + pi->picomp->numrlvls -
-                         rlvlno - 1)));
-                       pi->ystep = JAS_MIN(pi->ystep, pi->picomp->vsamp * (1 <<
-                         (pirlvl->prcheightexpn + pi->picomp->numrlvls -
-                         rlvlno - 1)));
+                       pi->xstep = JAS_MIN(pi->xstep, pi->picomp->hsamp *
+                         (JAS_CAST(uint_fast32_t, 1) << (pirlvl->prcwidthexpn +
+                         pi->picomp->numrlvls - rlvlno - 1)));
+                       pi->ystep = JAS_MIN(pi->ystep, pi->picomp->vsamp *
+                         (JAS_CAST(uint_fast32_t, 1) << (pirlvl->prcheightexpn 
+
+                         pi->picomp->numrlvls - rlvlno - 1)));
                }
                for (pi->y = pi->ystart; pi->y < pi->yend;
                  pi->y += pi->ystep - (pi->y % pi->ystep)) {
--- jasper-1.900.14/src/libjasper/jpc/jpc_t2cod.h       2017-03-16 
09:23:44.445202359 +0100
+++ jasper-1.900.14/src/libjasper/jpc/jpc_t2cod.h       2017-03-16 
09:25:00.433202141 +0100
@@ -129,10 +129,10 @@
        jpc_pirlvl_t *pirlvls;
 
        /* The horizontal sampling period. */
-       int hsamp;
+       uint_fast32_t hsamp;
 
        /* The vertical sampling period. */
-       int vsamp;
+       uint_fast32_t vsamp;
 
 } jpc_picomp_t;
 
@@ -171,32 +171,32 @@
        int lyrno;
 
        /* The x-coordinate of the current position. */
-       int x;
+       uint_fast32_t x;
 
        /* The y-coordinate of the current position. */
-       int y;
+       uint_fast32_t y;
 
        /* The horizontal step size. */
-       int xstep;
+       uint_fast32_t xstep;
 
        /* The vertical step size. */
-       int ystep;
+       uint_fast32_t ystep;
 
        /* The x-coordinate of the top-left corner of the tile on the reference
          grid. */
-       int xstart;
+       uint_fast32_t xstart;
 
        /* The y-coordinate of the top-left corner of the tile on the reference
          grid. */
-       int ystart;
+       uint_fast32_t ystart;
 
        /* The x-coordinate of the bottom-right corner of the tile on the
          reference grid (plus one). */
-       int xend;
+       uint_fast32_t xend;
 
        /* The y-coordinate of the bottom-right corner of the tile on the
          reference grid (plus one). */
-       int yend;
+       uint_fast32_t yend;
 
        /* The current progression change. */
        jpc_pchg_t *pchg;
++++++ jasper-CVE-2016-9600.patch ++++++
--- jasper-1.900.14/src/libjasper/jp2/jp2_enc.c 2017-03-17 09:43:12.997336723 
+0100
+++ jasper-1.900.14/src/libjasper/jp2/jp2_enc.c 2017-03-17 09:44:09.605336937 
+0100
@@ -112,6 +112,8 @@
 
        box = 0;
        tmpstream = 0;
+       iccstream = 0;
+       iccprof = 0;
 
        allcmptssame = 1;
        sgnd = jas_image_cmptsgnd(image, 0);
@@ -225,22 +227,36 @@
                colr->method = JP2_COLR_ICC;
                colr->pri = JP2_COLR_PRI;
                colr->approx = 0;
-               iccprof = jas_iccprof_createfromcmprof(jas_image_cmprof(image));
-               assert(iccprof);
-               iccstream = jas_stream_memopen(0, 0);
-               assert(iccstream);
-               if (jas_iccprof_save(iccprof, iccstream))
-                       abort();
-               if ((pos = jas_stream_tell(iccstream)) < 0)
-                       abort();
+               /* Ensure that cmprof_ is not null. */
+               if (!jas_image_cmprof(image)) {
+                       goto error;
+               }
+               if (!(iccprof = jas_iccprof_createfromcmprof(
+                 jas_image_cmprof(image)))) {
+                       goto error;
+               }
+               if (!(iccstream = jas_stream_memopen(0, 0))) {
+                       goto error;
+               }
+               if (jas_iccprof_save(iccprof, iccstream)) {
+                       goto error;
+               }
+               if ((pos = jas_stream_tell(iccstream)) < 0) {
+                       goto error;
+               }
                colr->iccplen = pos;
-               colr->iccp = jas_malloc(pos);
-               assert(colr->iccp);
+               if (!(colr->iccp = jas_malloc(pos))) {
+                       goto error;
+               }
                jas_stream_rewind(iccstream);
-               if (jas_stream_read(iccstream, colr->iccp, colr->iccplen) != 
colr->iccplen)
-                       abort();
+               if (jas_stream_read(iccstream, colr->iccp, colr->iccplen) !=
+                 colr->iccplen) {
+                       goto error;
+               }
                jas_stream_close(iccstream);
+               iccstream = 0;
                jas_iccprof_destroy(iccprof);
+               iccprof = 0;
                break;
        }
        if (jp2_box_put(box, tmpstream)) {
@@ -354,6 +370,12 @@
 
 error:
 
+       if (iccprof) {
+               jas_iccprof_destroy(iccprof);
+       }
+       if (iccstream) {
+               jas_stream_close(iccstream);
+       }
        if (box) {
                jp2_box_destroy(box);
        }
++++++ jasper-CVE-2017-5498.patch ++++++
--- jasper-1.900.14/configure.ac        2017-03-17 08:43:25.687753771 +0100
+++ jasper-1.900.14/configure.ac        2017-03-17 09:16:38.537161365 +0100
@@ -130,6 +130,16 @@
 /* If configure is being used, this symbol will be defined automatically
   at this point in the configuration header file. */
 
+#if defined(__GNUC__)
+#define JAS_ATTRIBUTE_DISABLE_USAN \
+  __attribute__((no_sanitize_undefined))
+#elif defined(__clang__)
+#define JAS_ATTRIBUTE_DISABLE_USAN \
+  __attribute__((no_sanitize("undefined")))
+#else
+#define JAS_ATTRIBUTE_DISABLE_USAN
+#endif
+
 /* The preprocessor symbol JAS_WIN_MSVC_BUILD should not be defined
   unless the JasPer software is being built under Microsoft Windows
   using Microsoft Visual C. */
--- jasper-1.900.14/src/appl/imgcmp.c   2017-03-17 08:43:25.687753771 +0100
+++ jasper-1.900.14/src/appl/imgcmp.c   2017-03-17 09:17:02.777161456 +0100
@@ -439,7 +439,7 @@
        s = 0.0;
        for (i = 0; i < jas_matrix_numrows(x); i++) {
                for (j = 0; j < jas_matrix_numcols(x); j++) {
-                       d = abs(jas_matrix_get(y, i, j) - jas_matrix_get(x, i, 
j));
+                       d = JAS_ABS(jas_matrix_get(y, i, j) - jas_matrix_get(x, 
i, j));
                        if (d > s) {
                                s = d;
                        }
--- jasper-1.900.14/src/appl/jiv.c      2017-03-17 08:43:25.687753771 +0100
+++ jasper-1.900.14/src/appl/jiv.c      2017-03-17 09:17:02.777161456 +0100
@@ -377,7 +377,7 @@
 
        assert(regwidth > 0);
        assert(regheight > 0);
-       assert(abs(((double) regheight / regwidth) - ((double) 
gs.viewportheight / gs.viewportwidth)) < 1e-5);
+       assert(JAS_ABS(((double) regheight / regwidth) - ((double) 
gs.viewportheight / gs.viewportwidth)) < 1e-5);
 
        glClear(GL_COLOR_BUFFER_BIT);
        glPixelStorei(GL_UNPACK_ALIGNMENT, sizeof(GLshort));
--- jasper-1.900.14/src/libjasper/include/jasper/jas_image.h    2017-03-17 
08:43:25.667753771 +0100
+++ jasper-1.900.14/src/libjasper/include/jasper/jas_image.h    2017-03-17 
09:17:02.777161456 +0100
@@ -93,8 +93,12 @@
  * Miscellaneous constants.
  */
 
+/* Basic units */
+#define JAS_IMAGE_KIBI                 (JAS_CAST(size_t, 1024))
+#define JAS_IMAGE_MEBI                 (JAS_IMAGE_KIBI * JAS_IMAGE_KIBI)
+
 /* The threshold at which image data is no longer stored in memory. */
-#define JAS_IMAGE_INMEMTHRESH  (16 * 1024 * 1024)
+#define JAS_IMAGE_INMEMTHRESH  (256 * JAS_IMAGE_MEBI)
 
 /*
  * Component types
--- jasper-1.900.14/src/libjasper/include/jasper/jas_math.h     2017-03-17 
08:43:25.667753771 +0100
+++ jasper-1.900.14/src/libjasper/include/jasper/jas_math.h     2017-03-17 
09:17:02.777161456 +0100
@@ -75,6 +75,7 @@
 
\******************************************************************************/
 
 #include <jasper/jas_config.h>
+#include <jasper/jas_types.h>
 
 #include <assert.h>
 #include <stdio.h>
@@ -116,9 +117,12 @@
 *
 
\******************************************************************************/
 
-__attribute__ ((no_sanitize_undefined))
+JAS_ATTRIBUTE_DISABLE_USAN
 inline static int jas_int_asr(int x, int n)
 {
+       // Ensure that the shift of a negative value appears to behave as a
+       // signed arithmetic shift.
+       assert(((-1) >> 1) == -1);
        assert(n >= 0);
        // The behavior is undefined when x is negative. */
        // We tacitly assume the behavior is equivalent to a signed
@@ -126,9 +130,12 @@
        return x >> n;
 }
 
-__attribute__ ((no_sanitize_undefined))
+JAS_ATTRIBUTE_DISABLE_USAN
 inline static int jas_int_asl(int x, int n)
 {
+       // Ensure that the shift of a negative value appears to behave as a
+       // signed arithmetic shift.
+       assert(((-1) << 1) == -2);
        assert(n >= 0);
        // The behavior is undefined when x is negative. */
        // We tacitly assume the behavior is equivalent to a signed
@@ -136,9 +143,12 @@
        return x << n;
 }
 
-__attribute__ ((no_sanitize_undefined))
+JAS_ATTRIBUTE_DISABLE_USAN
 inline static int jas_fast32_asr(int_fast32_t x, int n)
 {
+       // Ensure that the shift of a negative value appears to behave as a
+       // signed arithmetic shift.
+       assert(((JAS_CAST(int_fast32_t, -1)) >> 1) == JAS_CAST(int_fast32_t, 
-1));
        assert(n >= 0);
        // The behavior is undefined when x is negative. */
        // We tacitly assume the behavior is equivalent to a signed
@@ -146,9 +156,12 @@
        return x >> n;
 }
 
-__attribute__ ((no_sanitize_undefined))
+JAS_ATTRIBUTE_DISABLE_USAN
 inline static int jas_fast32_asl(int_fast32_t x, int n)
 {
+       // Ensure that the shift of a negative value appears to behave as a
+       // signed arithmetic shift.
+       assert(((JAS_CAST(int_fast32_t, -1)) << 1) == JAS_CAST(int_fast32_t, 
-2));
        assert(n >= 0);
        // The behavior is undefined when x is negative. */
        // We tacitly assume the behavior is equivalent to a signed
--- jasper-1.900.14/src/libjasper/jpc/jpc_enc.c 2017-03-17 08:43:25.671753771 
+0100
+++ jasper-1.900.14/src/libjasper/jpc/jpc_enc.c 2017-03-17 09:17:02.777161456 
+0100
@@ -1215,7 +1215,7 @@
                                        mxmag = 0;
                                        for (y = 0; y < JAS_CAST(uint_fast32_t, 
jas_matrix_numrows(band->data)); ++y) {
                                                for (x = 0; x < 
JAS_CAST(uint_fast32_t, jas_matrix_numcols(band->data)); ++x) {
-                                                       mag = 
abs(jas_matrix_get(band->data, y, x));
+                                                       mag = 
JAS_ABS(jas_matrix_get(band->data, y, x));
                                                        if (mag > mxmag) {
                                                                mxmag = mag;
                                                        }
--- jasper-1.900.14/src/libjasper/jpc/jpc_t1enc.c       2017-03-17 
08:43:25.671753771 +0100
+++ jasper-1.900.14/src/libjasper/jpc/jpc_t1enc.c       2017-03-17 
09:17:02.777161456 +0100
@@ -117,9 +117,9 @@
        jpc_enc_cblk_t *endcblks;
        int i;
        int j;
-       int mx;
-       int bmx;
-       int v;
+       jpc_fix_t mx;
+       jpc_fix_t bmx;
+       jpc_fix_t v;
        jpc_enc_tile_t *tile;
        uint_fast32_t prcno;
        jpc_enc_prc_t *prc;
@@ -148,7 +148,7 @@
                                                mx = 0;
                                                for (i = 0; i < 
jas_matrix_numrows(cblk->data); ++i) {
                                                        for (j = 0; j < 
jas_matrix_numcols(cblk->data); ++j) {
-                                                               v = 
abs(jas_matrix_get(cblk->data, i, j));
+                                                               v = 
JAS_ABS(jas_matrix_get(cblk->data, i, j));
                                                                if (v > mx) {
                                                                        mx = v;
                                                                }
@@ -407,15 +407,15 @@
 
 #define        sigpass_step(fp, frowstep, dp, bitpos, one, nmsedec, orient, 
mqenc, vcausalflag) \
 { \
-       int f; \
+       jpc_fix_t f; \
        int v; \
        f = *(fp); \
        if ((f & JPC_OTHSIGMSK) && !(f & (JPC_SIG | JPC_VISIT))) { \
-               v = (abs(*(dp)) & (one)) ? 1 : 0; \
+               v = (JAS_ABS(*(dp)) & (one)) ? 1 : 0; \
                jpc_mqenc_setcurctx(mqenc, JPC_GETZCCTXNO(f, (orient))); \
                jpc_mqenc_putbit(mqenc, v); \
                if (v) { \
-                       *(nmsedec) += JPC_GETSIGNMSEDEC(abs(*(dp)), (bitpos) + 
JPC_NUMEXTRABITS); \
+                       *(nmsedec) += JPC_GETSIGNMSEDEC(JAS_ABS(*(dp)), 
(bitpos) + JPC_NUMEXTRABITS); \
                        v = ((*(dp) < 0) ? 1 : 0); \
                        jpc_mqenc_setcurctx(mqenc, JPC_GETSCCTXNO(f)); \
                        jpc_mqenc_putbit(mqenc, v ^ JPC_GETSPB(f)); \
@@ -506,14 +506,14 @@
 #define        rawsigpass_step(fp, frowstep, dp, bitpos, one, nmsedec, out, 
vcausalflag) \
 { \
        jpc_fix_t f = *(fp); \
-       jpc_fix_t v; \
+       int v; \
        if ((f & JPC_OTHSIGMSK) && !(f & (JPC_SIG | JPC_VISIT))) { \
-               v = (abs(*(dp)) & (one)) ? 1 : 0; \
+               v = (JAS_ABS(*(dp)) & (one)) ? 1 : 0; \
                if ((jpc_bitstream_putbit((out), v)) == EOF) { \
                        return -1; \
                } \
                if (v) { \
-                       *(nmsedec) += JPC_GETSIGNMSEDEC(abs(*(dp)), (bitpos) + 
JPC_NUMEXTRABITS); \
+                       *(nmsedec) += JPC_GETSIGNMSEDEC(JAS_ABS(*(dp)), 
(bitpos) + JPC_NUMEXTRABITS); \
                        v = ((*(dp) < 0) ? 1 : 0); \
                        if (jpc_bitstream_putbit(out, v) == EOF) { \
                                return -1; \
@@ -619,9 +619,9 @@
        int v; \
        if (((*(fp)) & (JPC_SIG | JPC_VISIT)) == JPC_SIG) { \
                (d) = *(dp); \
-               *(nmsedec) += JPC_GETREFNMSEDEC(abs(d), (bitpos) + 
JPC_NUMEXTRABITS); \
+               *(nmsedec) += JPC_GETREFNMSEDEC(JAS_ABS(d), (bitpos) + 
JPC_NUMEXTRABITS); \
                jpc_mqenc_setcurctx((mqenc), JPC_GETMAGCTXNO(*(fp))); \
-               v = (abs(d) & (one)) ? 1 : 0; \
+               v = (JAS_ABS(d) & (one)) ? 1 : 0; \
                jpc_mqenc_putbit((mqenc), v); \
                *(fp) |= JPC_REFINE; \
        } \
@@ -708,11 +708,11 @@
 #define        rawrefpass_step(fp, dp, bitpos, one, nmsedec, out, vcausalflag) 
\
 { \
        jpc_fix_t d; \
-       jpc_fix_t v; \
+       int v; \
        if (((*(fp)) & (JPC_SIG | JPC_VISIT)) == JPC_SIG) { \
                d = *(dp); \
-               *(nmsedec) += JPC_GETREFNMSEDEC(abs(d), (bitpos) + 
JPC_NUMEXTRABITS); \
-               v = (abs(d) & (one)) ? 1 : 0; \
+               *(nmsedec) += JPC_GETREFNMSEDEC(JAS_ABS(d), (bitpos) + 
JPC_NUMEXTRABITS); \
+               v = (JAS_ABS(d) & (one)) ? 1 : 0; \
                if (jpc_bitstream_putbit((out), v) == EOF) { \
                        return -1; \
                } \
@@ -803,19 +803,19 @@
 
 #define        clnpass_step(fp, frowstep, dp, bitpos, one, orient, nmsedec, 
mqenc, label1, label2, vcausalflag) \
 { \
-       int f; \
+       jpc_fix_t f; \
        int v; \
 label1 \
        f = *(fp); \
        if (!(f & (JPC_SIG | JPC_VISIT))) { \
                jpc_mqenc_setcurctx(mqenc, JPC_GETZCCTXNO(f, (orient))); \
-               v = (abs(*(dp)) & (one)) ? 1 : 0; \
+               v = (JAS_ABS(*(dp)) & (one)) ? 1 : 0; \
                jpc_mqenc_putbit((mqenc), v); \
                if (v) { \
 label2 \
                        f = *(fp); \
                        /* Coefficient is significant. */ \
-                       *(nmsedec) += JPC_GETSIGNMSEDEC(abs(*(dp)), (bitpos) + 
JPC_NUMEXTRABITS); \
+                       *(nmsedec) += JPC_GETSIGNMSEDEC(JAS_ABS(*(dp)), 
(bitpos) + JPC_NUMEXTRABITS); \
                        jpc_mqenc_setcurctx((mqenc), JPC_GETSCCTXNO(f)); \
                        v = ((*(dp) < 0) ? 1 : 0); \
                        jpc_mqenc_putbit((mqenc), v ^ JPC_GETSPB(f)); \
@@ -876,7 +876,7 @@
                          !((*fp) & (JPC_SIG | JPC_VISIT | JPC_OTHSIGMSK)))) {
                                dp = dvscanstart;
                                for (k = 0; k < vscanlen; ++k) {
-                                       v = (abs(*dp) & one) ? 1 : 0;
+                                       v = (JAS_ABS(*dp) & one) ? 1 : 0;
                                        if (v) {
                                                break;
                                        }

Reply via email to