diff options
Diffstat (limited to 'converter')
-rw-r--r-- | converter/other/Makefile | 6 | ||||
-rw-r--r-- | converter/other/pnmtopalm/pnmtopalm.c | 2 | ||||
-rw-r--r-- | converter/pbm/pbmtonokia.c | 15 |
3 files changed, 21 insertions, 2 deletions
diff --git a/converter/other/Makefile b/converter/other/Makefile index 09a3e298..3b6d8288 100644 --- a/converter/other/Makefile +++ b/converter/other/Makefile @@ -86,9 +86,13 @@ PORTBINARIES = bmptopnm fitstopnm \ pbmtopgm pfmtopam \ pgmtopbm pgmtoppm ppmtopgm pnmtoddif \ pnmtopclxl \ - pnmtosgi pnmtosir pamtotga pnmtoxwd pstopnm \ + pnmtosgi pnmtosir pamtotga pnmtoxwd \ rlatopam sgitopnm sirtopnm xwdtopnm zeisstopnm +ifneq ($(DONT_HAVE_PROCESS_MGMT),Y) + PORTBINARIES += pstopnm +endif + BINARIES = $(PORTBINARIES) pnmtorast rasttopnm ifeq ($(HAVE_PNGLIB),Y) diff --git a/converter/other/pnmtopalm/pnmtopalm.c b/converter/other/pnmtopalm/pnmtopalm.c index 3b9eec8f..f5f6e44a 100644 --- a/converter/other/pnmtopalm/pnmtopalm.c +++ b/converter/other/pnmtopalm/pnmtopalm.c @@ -365,7 +365,7 @@ writeCommonHeader(unsigned int const cols, pm_error("Too many columns for Palm Bitmap: %u", cols); pm_writebigshort(stdout, cols); /* width */ if (rows > USHRT_MAX) - pm_error("Too many columns for Palm Bitmap: %u", rows); + pm_error("Too many rows for Palm Bitmap: %u", rows); pm_writebigshort(stdout, rows); /* height */ if (rowbytes > USHRT_MAX) pm_error("Too many bytes per row for Palm Bitmap: %u", rowbytes); diff --git a/converter/pbm/pbmtonokia.c b/converter/pbm/pbmtonokia.c index 3c47eac3..58d0ec5b 100644 --- a/converter/pbm/pbmtonokia.c +++ b/converter/pbm/pbmtonokia.c @@ -153,6 +153,20 @@ freeCmdline(struct cmdlineInfo const cmdline) { static void +checkSize(int cols, int rows){ + + if (cols > 255) + pm_error("This program cannot handle files with more than 255 " + "columns"); + if (rows > 255) + pm_error("This program cannot handle files with more than 255 " + "rows"); +} + + + + +static void convertToHexNol(bit ** const image, unsigned int const cols, unsigned int const rows, @@ -455,6 +469,7 @@ main(int argc, ifP = pm_openr(cmdline.inputFileName); bits = pbm_readpbm(ifP, &cols, &rows); pm_close(ifP); + checkSize(cols, rows); switch (cmdline.outputFormat) { case FMT_HEX_NGG: |