netpbm/netpbm-10.27-bmptopnm.patch
Jindrich Novy 001711f02e - update to 10.32
- drop .msbmp patch, aplied upstream
- sync the rest of the patches
- regenerate man pages
2006-02-28 12:59:04 +00:00

21 lines
763 B
Diff

--- netpbm-10.32/converter/other/bmptopnm.c.bmptopnm 2006-02-27 15:02:02.000000000 +0100
+++ netpbm-10.32/converter/other/bmptopnm.c 2006-02-27 15:07:31.000000000 +0100
@@ -1248,7 +1248,7 @@ readBmp(FILE * const ifP,
xel ** const colormapP,
bool const verbose) {
- xel * colormap; /* malloc'ed */
+ xel * colormap = NULL; /* malloc'ed */
unsigned int pos;
/* Current byte position in the BMP file */
@@ -1455,7 +1455,7 @@ main(int argc, char ** argv) {
writeRasterGen(BMPraster, cols, rows, outputType, cBitCount,
pixelformat, colormap);
}
- free(colormap);
+ if (colormap) free(colormap);
free(BMPraster);
return 0;