diff options
-rw-r--r-- | converter/pbm/ybmtopbm.c | 5 | ||||
-rw-r--r-- | doc/HISTORY | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/converter/pbm/ybmtopbm.c b/converter/pbm/ybmtopbm.c index 36f2dee7..78eb79f2 100644 --- a/converter/pbm/ybmtopbm.c +++ b/converter/pbm/ybmtopbm.c @@ -10,6 +10,8 @@ ** implied warranty. */ +#include <limits.h> + #include "pm.h" #include "pbm.h" #include "bitreverse.h" @@ -80,6 +82,9 @@ main(int argc, const char * argv[]) { getinit(ifP, &cols, &rows, &depth); if (depth != 1) pm_error("YBM file has depth of %u, must be 1", (unsigned int) depth); + if (cols > INT_MAX - 15) + pm_error("YBM file has uncomputably large width %d", cols); + pbm_writepbminit(stdout, cols, rows, 0); diff --git a/doc/HISTORY b/doc/HISTORY index 825ba0da..af31c32b 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -66,6 +66,10 @@ not yet BJH Release 11.04.00 tifftopnm: Fix incorrect output with really wide/deep rows. + thinkjettopbm: Fix incorrect output with really wide rows + + ybmtopbm: Fix incorrect output with really wide rows + library: add check of maxval for computable size. Build: Include LDFLAGS in link of shared library. |