Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package netpbm for openSUSE:Factory checked 
in at 2022-09-21 14:41:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/netpbm (Old)
 and      /work/SRC/openSUSE:Factory/.netpbm.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "netpbm"

Wed Sep 21 14:41:48 2022 rev:77 rq:1004994 version:10.96.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/netpbm/netpbm.changes    2022-09-15 
22:58:06.645032499 +0200
+++ /work/SRC/openSUSE:Factory/.netpbm.new.2083/netpbm.changes  2022-09-21 
14:42:40.437795146 +0200
@@ -1,0 +2,6 @@
+Sun Sep 18 09:15:29 UTC 2022 - Andreas Schwab <sch...@suse.de>
+
+- ppmforge-fix-overflow.patch: Fix arithmetic overflow in ppmforge
+- ppmforge-test.patch: removed
+
+-------------------------------------------------------------------

Old:
----
  ppmforge-test.patch

New:
----
  ppmforge-fix-overflow.patch

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

Other differences:
------------------
++++++ netpbm.spec ++++++
--- /var/tmp/diff_new_pack.H8aJwR/_old  2022-09-21 14:42:41.177797199 +0200
+++ /var/tmp/diff_new_pack.H8aJwR/_new  2022-09-21 14:42:41.185797221 +0200
@@ -47,8 +47,8 @@
 Patch7:         big-endian.patch
 # bsc#1144255 disable jpeg2k support due to removal of jasper
 Patch8:         netpbm-disable-jasper.patch
-# PATCH-FIX-UPSTREAM fix ppmforge test to avoid float overflow
-Patch9:         ppmforge-test.patch
+# PATCH-FIX-UPSTREAM fix arithmetic overflow in ppmforge 
(https://sourceforge.net/p/netpbm/code/4428/)
+Patch9:         ppmforge-fix-overflow.patch
 BuildRequires:  flex
 BuildRequires:  libjpeg-devel
 BuildRequires:  libpng-devel

++++++ ppmforge-fix-overflow.patch ++++++
Index: netpbm/generator/ppmforge.c
===================================================================
--- netpbm/generator/ppmforge.c (revision 4427)
+++ netpbm/generator/ppmforge.c (revision 4428)
@@ -241,7 +241,7 @@
 
 
 static void
-fourn(float *     const data,
+fourn(double *    const data,
       const int * const nn,
       int         const ndim,
       int         const isign) {
@@ -272,7 +272,7 @@
     int i1, i2, i3;
     int i2rev, i3rev, ip1, ip2, ip3, ifp1, ifp2;
     int ibit, idim, k1, k2, n, nprev, nrem, ntot;
-    float tempi, tempr;
+    double tempi, tempr;
     double theta, wi, wpi, wpr, wr, wtemp;
 
 #define SWAP(a,b) tempr=(a); (a) = (b); (b) = tempr
@@ -401,7 +401,7 @@
 
 
 static void
-spectralsynth(float **       const x,
+spectralsynth(double **      const aP,
               unsigned int   const n,
               double         const h,
               struct Gauss * const gaussP) {
@@ -411,18 +411,20 @@
   This algorithm is given under the name SpectralSynthesisFM2D on page 108 of
   Peitgen & Saupe.
 -----------------------------------------------------------------------------*/
-    unsigned bl;
+    unsigned int const bl = ((((unsigned long) n) * n) + 1) * 2;
+
     int i, j, i0, j0, nsize[3];
     double rad, phase, rcos, rsin;
-    float *a;
+    double * a;
 
-    bl = ((((unsigned long) n) * n) + 1) * 2 * sizeof(float);
-    a = (float *) calloc(bl, 1);
-    if (a == (float *) 0) {
-        pm_error("Cannot allocate %d x %d result array (% d bytes).",
+    MALLOCARRAY(a, bl);
+
+    if (!a) {
+        pm_error("Cannot allocate %u x %u result array (%u doubles).",
                  n, n, bl);
     }
-    *x = a;
+    for (i = 0; i < bl; ++i)
+        a[i] = 0.0;  /* initial value */
 
     for (i = 0; i <= n / 2; i++) {
         for (j = 0; j <= n / 2; j++) {
@@ -463,6 +465,8 @@
     nsize[0] = 0;
     nsize[1] = nsize[2] = n;          /* Dimension of frequency domain array */
     fourn(a, nsize, 2, -1);       /* Take inverse 2D Fourier transform */
+
+    *aP = a;
 }
 
 
@@ -572,9 +576,9 @@
 
 
 static unsigned char *
-makeCp(float *      const a,
-       unsigned int const n,
-       pixval       const maxval) {
+makeCp(const double * const a,
+       unsigned int   const n,
+       pixval         const maxval) {
 
     /* Prescale the grid points into intensities. */
 
@@ -587,7 +591,7 @@
     if (cp == NULL)
         pm_error("Unable to allocate %u bytes for cp array", n);
 
-    ap = cp;
+    ap = cp;  /* initial value */
     {
         unsigned int i;
         for (i = 0; i < n; i++) {
@@ -603,7 +607,7 @@
 
 static void
 createPlanetStuff(bool             const clouds,
-                  float *          const a,
+                  const double *   const a,
                   unsigned int     const n,
                   double **        const uP,
                   double **        const u1P,
@@ -977,7 +981,7 @@
 static void
 genplanet(bool           const stars,
           bool           const clouds,
-          float *        const a,
+          const double * const a,
           unsigned int   const cols,
           unsigned int   const rows,
           unsigned int   const n,
@@ -1052,7 +1056,7 @@
 
 
 static void
-applyPowerLawScaling(float * const a,
+applyPowerLawScaling(double * const a,
                      int     const meshsize,
                      double  const powscale) {
 
@@ -1065,7 +1069,7 @@
             for (j = 0; j < meshsize; j++) {
                 double const r = Real(a, i, j);
                 if (r > 0)
-                    Real(a, i, j) = pow(r, powscale);
+                    Real(a, i, j) = MIN(hugeVal, pow(r, powscale));
             }
         }
     }
@@ -1074,10 +1078,10 @@
 
 
 static void
-computeExtremeReal(const float * const a,
-                   int           const meshsize,
-                   double *      const rminP,
-                   double *      const rmaxP) {
+computeExtremeReal(const double * const a,
+                   int            const meshsize,
+                   double *       const rminP,
+                   double *       const rmaxP) {
 
     /* Compute extrema for autoscaling. */
 
@@ -1103,8 +1107,8 @@
 
 
 static void
-replaceWithSpread(float * const a,
-                  int     const meshsize) {
+replaceWithSpread(double * const a,
+                  int      const meshsize) {
 /*----------------------------------------------------------------------------
   Replace the real part of each element of the 'a' array with a
   measure of how far the real is from the middle; sort of a standard
@@ -1138,7 +1142,7 @@
 /*----------------------------------------------------------------------------
    Make a planet.
 -----------------------------------------------------------------------------*/
-    float * a;
+    double * a;
     bool error;
     struct Gauss gauss;
 
@@ -1149,7 +1153,7 @@
         error = FALSE;
     } else {
         spectralsynth(&a, meshsize, 3.0 - fracdim, &gauss);
-        if (a == NULL) {
+        if (!a) {
             error = TRUE;
         } else {
             applyPowerLawScaling(a, meshsize, powscale);
Index: netpbm/test/ppmforge.test
===================================================================
--- netpbm/test/ppmforge.test   (revision 4427)
+++ netpbm/test/ppmforge.test   (revision 4428)
@@ -47,6 +47,6 @@
     -inclination 9  -hour 12 -power 200 > ${test_ppm} 
 ppmforge -seed 1 -stars 0 -ice 0.01 \
     -inclination 10 -hour 12 -power 200 | \
-  pnmpsnr -target1=53.89 -target2=49.38 -target3=65.15 - ${test_ppm}
+  pnmpsnr -target1=46.07 -target2=52.00 -target3=67.77 - ${test_ppm}
 
 rm ${test_ppm}

Reply via email to