diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c index fe8a6ea..b7b4b01 100644 --- a/tools/tiff2pdf.c +++ b/tools/tiff2pdf.c @@ -747,7 +747,7 @@ int main(int argc, char** argv){ /* * Input */ - if(argc > optind) { + if(argv && (argc > optind)) { input = TIFFOpen(argv[optind++], "r"); if (input==NULL) { TIFFError(TIFF2PDF_MODULE, diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c index 82a5d84..3563f30 100644 --- a/tools/tiff2ps.c +++ b/tools/tiff2ps.c @@ -2964,7 +2964,9 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw if ( val32 == 0 ) /* Special case */ { - ascii85_p[ascii85_l] = 'z'; + if(ascii85_p != NULL) { + ascii85_p[ascii85_l] = 'z'; + } rc = 1; } diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c index 722b132..470a18d 100644 --- a/tools/tiffcrop.c +++ b/tools/tiffcrop.c @@ -958,7 +958,6 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, return 1; } } - prev_trailing_bits += trailing_bits; /* if (prev_trailing_bits > 7) */ /* prev_trailing_bits-= 8; */ }