tiff2ps.c: fix buffer overread

fixes #193
This commit is contained in:
Thomas Bernard 2020-11-10 03:00:27 +01:00
parent 19ff8a6e97
commit b7cc4f7ef1
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF

View File

@ -2715,7 +2715,7 @@ PSDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
#if defined( EXP_ASCII85ENCODER )
if (alpha) {
int adjust, i;
for (i = 0; i < cc; i+=2) {
for (i = 0; i < (cc - 1); i+=2) {
adjust = 255 - cp[i + 1];
cp[i / 2] = cp[i] + adjust;
}