mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibGfx: Remove use of ByteBuffer::wrap() in BMP decoder
This commit is contained in:
parent
8cf6b75dd9
commit
77515fead2
Notes:
sideshowbarker
2024-07-19 00:44:48 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/77515fead23
1 changed files with 5 additions and 3 deletions
|
@ -1187,15 +1187,17 @@ static bool decode_bmp_pixel_data(BMPLoadingContext& context)
|
|||
return false;
|
||||
}
|
||||
|
||||
auto buffer = ByteBuffer::wrap(const_cast<u8*>(context.file_bytes + context.data_offset), context.file_size - context.data_offset);
|
||||
ByteBuffer rle_buffer;
|
||||
ReadonlyBytes bytes { context.file_bytes + context.data_offset, context.file_size - context.data_offset };
|
||||
|
||||
if (context.dib.info.compression == Compression::RLE4 || context.dib.info.compression == Compression::RLE8
|
||||
|| context.dib.info.compression == Compression::RLE24) {
|
||||
if (!uncompress_bmp_rle_data(context, buffer))
|
||||
if (!uncompress_bmp_rle_data(context, rle_buffer))
|
||||
return false;
|
||||
bytes = rle_buffer.bytes();
|
||||
}
|
||||
|
||||
Streamer streamer(buffer.data(), buffer.size());
|
||||
Streamer streamer(bytes.data(), bytes.size());
|
||||
|
||||
auto process_row = [&](u32 row) -> bool {
|
||||
u32 space_remaining_before_consuming_row = streamer.remaining();
|
||||
|
|
Loading…
Reference in a new issue