diff options
Diffstat (limited to 'converter')
-rw-r--r-- | converter/other/pnmtopalm/palmtopnm.c | 11 | ||||
-rw-r--r-- | converter/pbm/pbmtoibm23xx.c | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/converter/other/pnmtopalm/palmtopnm.c b/converter/other/pnmtopalm/palmtopnm.c index 88088817..e686571b 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, diff --git a/converter/pbm/pbmtoibm23xx.c b/converter/pbm/pbmtoibm23xx.c index a83e260d..334b649d 100644 --- a/converter/pbm/pbmtoibm23xx.c +++ b/converter/pbm/pbmtoibm23xx.c @@ -4,7 +4,7 @@ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version - * 2 as published by the Free Software Foundation. + * 2 or later as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of |