From a326e598067c2ca406456a7f7f7937c6ba0f2368 Mon Sep 17 00:00:00 2001 From: CodeAi Date: Tue, 9 Jan 2018 15:02:47 -0500 Subject: [PATCH 1/5] CodeAi generated fix --- tools/tiff2ps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } From 2fb5e317b6e96ac789bef0334b1a737959f64f14 Mon Sep 17 00:00:00 2001 From: CodeAi Date: Tue, 9 Jan 2018 15:37:14 -0500 Subject: [PATCH 2/5] CodeAi generated fix --- tools/tiffcrop.c | 1 - 1 file changed, 1 deletion(-) 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; */ } From f74b212b17cbffa1090802016e2057e429a9b1fb Mon Sep 17 00:00:00 2001 From: CodeAi Date: Tue, 9 Jan 2018 16:46:18 -0500 Subject: [PATCH 3/5] CodeAi generated fix From fd1aa352ea0d52cbd637976b09b542e898bbcd75 Mon Sep 17 00:00:00 2001 From: CodeAi Date: Tue, 9 Jan 2018 16:47:04 -0500 Subject: [PATCH 4/5] CodeAi generated fix From c19952ef104ebd9260c61f8ca076fc57c145c882 Mon Sep 17 00:00:00 2001 From: CodeAi <22505183+C0deAi@users.noreply.github.com> Date: Mon, 22 Jan 2018 11:47:05 -0500 Subject: [PATCH 5/5] CodeAi generated fix --- tools/tiff2ps.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c index 3563f30..776ad2c 100644 --- a/tools/tiff2ps.c +++ b/tools/tiff2ps.c @@ -2964,9 +2964,7 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw if ( val32 == 0 ) /* Special case */ { - if(ascii85_p != NULL) { - ascii85_p[ascii85_l] = 'z'; - } + ascii85_p[ascii85_l] = 'z'; rc = 1; } @@ -3032,7 +3030,7 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw * If requested add an ASCII85 End Of Data marker: */ - if ( f_eod ) + if ( ascii85_p && (f_eod )) { ascii85_p[ascii85_l++] = '~'; ascii85_p[ascii85_l++] = '>';