1 Index: tiff-4.0.3/tools/ppm2tiff.c
2 ===================================================================
3 --- tiff-4.0.3.orig/tools/ppm2tiff.c 2013-06-23 10:36:50.779629492 -0400
4 +++ tiff-4.0.3/tools/ppm2tiff.c 2013-06-23 10:36:50.775629494 -0400
9 + tmsize_t scanline_size;
12 fprintf(stderr, "%s: Too few arguments\n", argv[0]);
15 if (TIFFScanlineSize(out) > linebytes)
16 buf = (unsigned char *)_TIFFmalloc(linebytes);
18 - buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
20 + scanline_size = TIFFScanlineSize(out);
21 + if (scanline_size != 0)
22 + buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
24 + fprintf(stderr, "%s: scanline size overflow\n",infile);
25 + (void) TIFFClose(out);
30 TIFFSetField(out, TIFFTAG_XRESOLUTION, resolution);
31 TIFFSetField(out, TIFFTAG_YRESOLUTION, resolution);