diff options
-rw-r--r-- | converter/other/pnmtopalm/palmtopnm.c | 11 | ||||
-rw-r--r-- | doc/HISTORY | 6 | ||||
-rw-r--r-- | version.mk | 2 |
3 files changed, 18 insertions, 1 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, diff --git a/doc/HISTORY b/doc/HISTORY index c859fe42..c6f84b3a 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,12 @@ Netpbm. CHANGE HISTORY -------------- +17.09.13 BJH Release 10.78.06 + + palmtopnm: fix crash if invalid input contains color index that + is not in the palette. Always broken (palmtopnm was new in + Netpbm 9.10 (October 2001)). + 17.09.10 BJH Release 10.79.05 pnmtopalm: fix incorrect output with certain input files and diff --git a/version.mk b/version.mk index 71e25303..6f219ffa 100644 --- a/version.mk +++ b/version.mk @@ -1,3 +1,3 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 79 -NETPBM_POINT_RELEASE = 5 +NETPBM_POINT_RELEASE = 6 |