summaryrefslogtreecommitdiff
path: root/pcl
diff options
context:
space:
mode:
authorJulian Smith <julian.smith@artifex.com>2022-04-07 21:18:45 +0100
committerJulian Smith <julian.smith@artifex.com>2022-04-08 14:00:25 +0100
commit250afadfa2dfbea8f0e68f0dac08ea9d38ceaaf6 (patch)
tree30db7d44a5e9050bef42c158040ac63376daa744 /pcl
parent276dc19f45bf09c8f1273d01ed5ce7c0161d7369 (diff)
downloadghostpdl-250afadfa2dfbea8f0e68f0dac08ea9d38ceaaf6.tar.gz
pcl/pcl/rtrstcmp.c:uncompress_9(): fix for bug 705155.
Don't let <i> decrement below zero.
Diffstat (limited to 'pcl')
-rw-r--r--pcl/pcl/rtrstcmp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pcl/pcl/rtrstcmp.c b/pcl/pcl/rtrstcmp.c
index c1dfc9984..56e154e72 100644
--- a/pcl/pcl/rtrstcmp.c
+++ b/pcl/pcl/rtrstcmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -183,14 +183,16 @@ uncompress_9(pcl_seed_row_t * pout, const byte * pin, int in_size)
more_cnt = (cnt == 0x8);
}
- while (more_offset && (i-- > 0)) {
+ while (more_offset && (i > 0)) {
uint extra = *pin++;
+ i -= 1;
more_offset = (extra == 0xff);
offset += extra;
}
- while (more_cnt && (i-- > 0)) {
+ while (more_cnt && (i > 0)) {
uint extra = *pin++;
+ i -= 1;
more_cnt = (extra == 0xff);
offset += extra;