about summary refs log tree commit diff
path: root/converter/other
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-09-13 15:45:04 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-09-13 15:45:04 +0000
commit8bdace1a332a39236338485b73898a81a88e757e (patch)
tree799956243bead596058d4787b98036818b10fbe6 /converter/other
parent778a245464d8b91ae4e567da2757fe5a523df4bf (diff)
downloadnetpbm-mirror-8bdace1a332a39236338485b73898a81a88e757e.tar.gz
netpbm-mirror-8bdace1a332a39236338485b73898a81a88e757e.tar.xz
netpbm-mirror-8bdace1a332a39236338485b73898a81a88e757e.zip
Release 10.78.06
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3060 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rw-r--r--converter/other/pnmtopalm/palmtopnm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/converter/other/pnmtopalm/palmtopnm.c b/converter/other/pnmtopalm/palmtopnm.c
index 00aa35e4..0f76207d 100644
--- a/converter/other/pnmtopalm/palmtopnm.c
+++ b/converter/other/pnmtopalm/palmtopnm.c
@@ -688,6 +688,11 @@ doTransparent(FILE *                 const ofP,
                                                colormap->ncolors,
                                                sizeof(color), 
                                                palmcolor_compare_indices));
+            if (!actualColor)
+                pm_error("Invalid input; transparent index %u "
+                         "is not among the %u colors in the image's colormap",
+                         transparentIndex, colormap->ncolors);
+
             fprintf(ofP, "#%02x%02x%02x\n", 
                    (unsigned int) ((*actualColor >> 16) & 0xFF),
                    (unsigned int) ((*actualColor >>  8) & 0xFF), 
@@ -1020,6 +1025,12 @@ convertRowToPnmNotDirect(const unsigned char * const palmrow,
                                                   colormap->ncolors,
                                                   sizeof(color2), 
                                                   palmcolor_compare_indices));
+            if (!actualColor)
+                pm_error("Invalid input.  A color index in column %u "
+                         "is %u, which is not among the %u colors "
+                         "in the colormap",
+                         j, color, colormap->ncolors);
+
             PPM_ASSIGN(xelrow[j], 
                        (*actualColor >> 16) & 0xFF, 
                        (*actualColor >>  8) & 0xFF,