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..7664556 100644 --- a/tools/tiffcrop.c +++ b/tools/tiffcrop.c @@ -1745,7 +1745,7 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32 case 'C': *mp++ = 'c'; *mp = '\0'; break; /* options for Debugging / data dump */ - case 'D': for (i = 0, opt_ptr = strtok (optarg, ","); + case (opt_ptr != NULL); (opt_ptr = strtok (NULL, ",")), i++) {