mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibGfx/CCITT: Don't overrun the image width
This commit is contained in:
committed by
Jelle Raaijmakers
parent
720187623b
commit
a4b2e5b27b
Notes:
sideshowbarker
2024-07-17 10:31:19 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/a4b2e5b27b Pull-request: https://github.com/SerenityOS/serenity/pull/23169
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user