diff options
Diffstat (limited to 'converter/other')
-rw-r--r-- | converter/other/pnmtopng.c | 7 | ||||
-rw-r--r-- | converter/other/pnmtops.c | 4 |
2 files changed, 9 insertions, 2 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, " |