diff options
Diffstat (limited to 'converter')
-rwxr-xr-x | converter/other/anytopnm | 2 | ||||
-rw-r--r-- | converter/other/pamtohtmltbl.c | 6 | ||||
-rw-r--r-- | converter/pbm/pbmtogo.c | 5 | ||||
-rw-r--r-- | converter/ppm/tgatoppm.c | 2 | ||||
-rw-r--r-- | converter/ppm/xvminitoppm.c | 5 |
5 files changed, 17 insertions, 3 deletions
diff --git a/converter/other/anytopnm b/converter/other/anytopnm index 6c56b5ef..b2873772 100755 --- a/converter/other/anytopnm +++ b/converter/other/anytopnm @@ -528,7 +528,7 @@ putInputIntoTempfile "$inputFile" "$file" setMimeType "$file" -typeDescription=`file "$file" | cut -d: -f2- | cut -c2` +typeDescription=`file "$file" | cut -d: -f2- | cut -c2-` determineType "$file" "$mimeType" "$typeDescription" "$fileExtension" diff --git a/converter/other/pamtohtmltbl.c b/converter/other/pamtohtmltbl.c index 293badcb..0afbfea0 100644 --- a/converter/other/pamtohtmltbl.c +++ b/converter/other/pamtohtmltbl.c @@ -180,9 +180,15 @@ allocOutputtedArray(unsigned int const width, unsigned int const height) { pm_error("Unable to allocate space for 'outputted' array"); for (row = 0; row < height; ++row) { + unsigned int col; + MALLOCARRAY(outputted[row], width); if (outputted[row] == NULL) pm_error("Unable to allocate space for 'outputted' array"); + + for (col = 0; col < width ; ++col) + outputted[row][col] = FALSE; + } return outputted; } diff --git a/converter/pbm/pbmtogo.c b/converter/pbm/pbmtogo.c index b7c12373..36b145c4 100644 --- a/converter/pbm/pbmtogo.c +++ b/converter/pbm/pbmtogo.c @@ -88,6 +88,11 @@ main( argc, argv ) ifp = stdin; pbm_readpbminit(ifp, &cols, &rows, &format); + + if (cols > 1056) + pm_error("Image is wider (%u pixels) than a Graphon terminal " + "(%u pixels)", cols, 1056); + bitrow = pbm_allocrow(cols); /* Round cols up to the nearest multiple of 8. */ diff --git a/converter/ppm/tgatoppm.c b/converter/ppm/tgatoppm.c index 9f2bc4c0..8a559848 100644 --- a/converter/ppm/tgatoppm.c +++ b/converter/ppm/tgatoppm.c @@ -73,7 +73,7 @@ parseCommandLine(int argc, char ** argv, /* Uses and sets argc, argv, and some of *cmdlineP and others. */ if (argc - 1 == 0) - cmdlineP->input_filename = "="; /* he wants stdin */ + cmdlineP->input_filename = "-"; /* he wants stdin */ else if (argc - 1 == 1) cmdlineP->input_filename = strdup(argv[1]); else diff --git a/converter/ppm/xvminitoppm.c b/converter/ppm/xvminitoppm.c index dfc76fcf..030139fa 100644 --- a/converter/ppm/xvminitoppm.c +++ b/converter/ppm/xvminitoppm.c @@ -127,6 +127,9 @@ readXvHeader(FILE * const ifP, "It does not consist of 3 decimal numbers.", buf); if (maxval != 255) pm_error("bogus XV thumbnail maxval %u. Should be 255", maxval); + *colsP = cols; + *rowsP = rows; + *maxvalP = maxval; } @@ -160,7 +163,7 @@ writePpm(FILE * const ifP, pm_error("unexpected EOF"); else { unsigned int const paletteIndex = byte; - assert(byte > 0); + assert(byte >= 0); PPM_ASSIGN(pixrow[col], xvPaletteP->red[paletteIndex], |