about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-03-22 01:24:19 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-03-22 01:24:19 +0000
commita36d2f6acdddc16d78f2f986c5ff58a91f4630b8 (patch)
treecb970064adf445ce689cbae6b29fc8a9dbd0f903
parente3c883f91be7421e0822ec5fdc27099761a672f9 (diff)
downloadnetpbm-mirror-a36d2f6acdddc16d78f2f986c5ff58a91f4630b8.tar.gz
netpbm-mirror-a36d2f6acdddc16d78f2f986c5ff58a91f4630b8.tar.xz
netpbm-mirror-a36d2f6acdddc16d78f2f986c5ff58a91f4630b8.zip
Release 10.86.20
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@4059 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/pnmtopng.c7
-rw-r--r--converter/other/pnmtops.c4
-rw-r--r--doc/HISTORY15
-rw-r--r--version.mk2
4 files changed, 25 insertions, 3 deletions
diff --git a/converter/other/pnmtopng.c b/converter/other/pnmtopng.c
index 60b8276b..ed852fd0 100644
--- a/converter/other/pnmtopng.c
+++ b/converter/other/pnmtopng.c
@@ -961,6 +961,8 @@ tryTransparentColor(FILE *     const ifp,
             }
         }
     }
+    *singleColorIsTransP = singleColorIsTrans;
+
     pnm_freerow(xelrow);
 }
 
@@ -1468,9 +1470,14 @@ computeUnsortedAlphaPalette(FILE *           const ifP,
     int row;
     xel * xelrow;
     unsigned int alphaColorPairCnt;
+        /* Number of different alpha/color pairs we've seen so far as we
+           iterate through the image.
+        */
 
     cht = ppm_colorhisttocolorhash(chv, colors);
 
+    /* We have not seen any alphas of any color yet. */
+    alphaColorPairCnt = 0;
     for (colorIndex = 0; colorIndex < colors; ++colorIndex) {
         alphasOfColor[colorIndex] = NULL;
         alphasOfColorCnt[colorIndex] = 0;
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index de0dfd8d..a286bc1e 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -1012,8 +1012,8 @@ validateComputableBoundingBox(float const scols,
     float const bbWidth  = llx + scols + 0.5;
     float const bbHeight = lly + srows + 0.5;
 
-    if (bbHeight < INT_MIN || bbHeight > INT_MAX ||
-        bbWidth  < INT_MIN || bbWidth  > INT_MAX)
+    if ((double)bbHeight < INT_MIN || (double)bbHeight > INT_MAX ||
+        (double)bbWidth  < INT_MIN || (double)bbWidth  > INT_MAX)
         pm_error("Bounding box dimensions %.1f x %.1f are too large "
                  "for computations.  "
                  "This probably means input image width, height, "
diff --git a/doc/HISTORY b/doc/HISTORY
index 7bf977f2..0c16ff5c 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,21 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+21.03.21 BJH  Release 10.86.20
+
+              pnmtopng: fix incorrect transparency in output when requesting
+              transparency.  Introduced after Netpbm 10.35 (August 2006) but
+              not after Netpbm 10.47 (June 2009).
+
+              pnmtopng: fix buffer overrun or bogus "too many color/
+              transparency pairs" failure when requesting transparency.
+              Introduced after Netpbm 10.26 (January 2005) but not after
+              Netpbm 10.35 (August 2006).
+
+              pnmtops: Fix incorrect output (arithmetic overflow) when
+              bounding box is exactly INT_MAX high or wide.  Always broken.
+              Pnmtops was in primordial Netpbm.
+
 21.03.07 BJH  Release 10.86.19
 
               pamscale: fix bogus "bad magic number" or similar failure most
diff --git a/version.mk b/version.mk
index d51677df..419a3049 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 86
-NETPBM_POINT_RELEASE = 19
+NETPBM_POINT_RELEASE = 20