From 5c3871168f323521fe2f5bd776b5c83af3cc1280 Mon Sep 17 00:00:00 2001 From: Aizal Khan Date: Sun, 12 Jul 2026 02:49:26 +0530 Subject: [PATCH] bound OutputLine bit deinterleave to BitBuffer in rastertohp --- filter/rastertohp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filter/rastertohp.c b/filter/rastertohp.c index 05af10e64..a9f028bc8 100644 --- a/filter/rastertohp.c +++ b/filter/rastertohp.c @@ -538,7 +538,7 @@ OutputLine(cups_page_header2_t *header) /* I - Page header */ for (count = header->cupsBytesPerLine / NumPlanes, plane_ptr = Planes[plane], bit_ptr = BitBuffer; - count > 0; + count > 0 && bit_ptr < (BitBuffer + bytes); count -= 2, plane_ptr += 2, bit_ptr ++) { bit = plane_ptr[0];