From 8bdace1a332a39236338485b73898a81a88e757e Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 13 Sep 2017 15:45:04 +0000 Subject: Release 10.78.06 git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3060 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/pnmtopalm/palmtopnm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'converter/other') 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, -- cgit 1.4.1