From a4b2e5b27b27f7243b0e5bef139290837f9501bc Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sun, 11 Feb 2024 18:46:21 -0500 Subject: [PATCH] LibGfx/CCITT: Don't overrun the image width --- Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp b/Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp index b137f18f7f..cadc90d582 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp @@ -273,7 +273,7 @@ ErrorOr decode_single_ccitt3_1d_line(BigEndianInputBitStream& input_bit_st u32 run_length = 0; u32 column = 0; - while (column < image_width) { + while (column < image_width - 1) { if (run_length > 0) { run_length--; TRY(decoded_bits.write_bits(current_color == ccitt_white ? 0u : 1u, 1));