From 93d07d0633e31bec3ec638142d0ff39b9f0eeec8 Mon Sep 17 00:00:00 2001 From: Aizal Khan Date: Sun, 5 Jul 2026 13:49:07 +0530 Subject: [PATCH] fix out-of-bounds read in rastertolabel delta-row compare --- filter/rastertolabel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/filter/rastertolabel.c b/filter/rastertolabel.c index 0434d159e..bee0f2aa8 100644 --- a/filter/rastertolabel.c +++ b/filter/rastertolabel.c @@ -953,8 +953,8 @@ PCLCompress(unsigned char *line, /* I - Line to compress */ * The seed buffer is valid, so compare against it... */ - while (*line_ptr == *seed && - line_ptr < line_end) + while (line_ptr < line_end && + *line_ptr == *seed) { line_ptr ++; seed ++; @@ -971,8 +971,8 @@ PCLCompress(unsigned char *line, /* I - Line to compress */ start = line_ptr; count = 0; - while (*line_ptr != *seed && - line_ptr < line_end && + while (line_ptr < line_end && + *line_ptr != *seed && count < 8) { line_ptr ++;