1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibGfx/CCITT: Don't overrun the image width

This commit is contained in:
Lucas CHOLLET 2024-02-11 18:46:21 -05:00 committed by Jelle Raaijmakers
parent 720187623b
commit a4b2e5b27b

View file

@ -273,7 +273,7 @@ ErrorOr<void> 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));