diff options
-rw-r--r-- | doc/HISTORY | 4 | ||||
-rw-r--r-- | other/pamarith.c | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/doc/HISTORY b/doc/HISTORY index fd0113be..5b06e3dd 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -31,8 +31,8 @@ not yet BJH Release 10.92.00 jpeg2ktopam: Fix crash whenever the program fails. Broken in Netpbm 10.42 (March 2008). - pamarith: Fix crash with -compare where inputs are PBM. Broken - in Netpbm 10.14 (February 2003). + pamarith: Fix crash with -compare where inputs are PBM or + BLACKANDWHITE PAM. Broken in Netpbm 10.14 (February 2003). pamfunc: Fix crash with -changemaxval and PBM or BLACKANDWHITE PAM input. Always broken. -changemaxval was new in Netpbm diff --git a/other/pamarith.c b/other/pamarith.c index 12c102b3..c67c7326 100644 --- a/other/pamarith.c +++ b/other/pamarith.c @@ -4,6 +4,7 @@ #include "pm_c_util.h" #include "mallocvar.h" +#include "nstring.h" #include "shhopt.h" #include "pam.h" @@ -289,7 +290,11 @@ computeOutputType(struct pam * const outpamP, outpamP->maxval = inpam1.maxval; } outpamP->bytes_per_sample = (pm_maxvaltobits(outpamP->maxval)+7)/8; - strcpy(outpamP->tuple_type, inpam1.tuple_type); + + if (outpamP->maxval > 1 && strneq(inpam1.tuple_type, "BLACKANDWHITE", 13)) + strcpy(outpamP->tuple_type, ""); + else + strcpy(outpamP->tuple_type, inpam1.tuple_type); } |