mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibGfx/ILBMLoader: Stop the decoding loop when plane buffer is full
This allows decoding files (eg. 24bit) that may have been badly encoded.
This commit is contained in:
parent
19a2cc5634
commit
caa13d3960
Notes:
sideshowbarker
2024-07-17 08:35:21 +09:00
Author: https://github.com/warpdesign Commit: https://github.com/SerenityOS/serenity/commit/caa13d3960 Pull-request: https://github.com/SerenityOS/serenity/pull/22287 Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/LucasChollet ✅ Reviewed-by: https://github.com/gmta
@ -233,7 +233,8 @@ static ErrorOr<ByteBuffer> uncompress_byte_run(ReadonlyBytes data, ILBMLoadingCo
|
||||
|
||||
u32 index = 0;
|
||||
u32 read_bytes = 0;
|
||||
while (read_bytes < length) {
|
||||
// Uncompressing is done once we've read all buffer or plane buffer has been fully filled
|
||||
while (read_bytes < length && index < plane_data_size) {
|
||||
auto const byte = static_cast<i8>(data[read_bytes++]);
|
||||
if (byte >= -127 && byte <= -1) {
|
||||
// read next byte
|
||||
|
Loading…
Reference in New Issue
Block a user