1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

LibGfx: Let decode_bmp_v5_dib() skip reserved field

This has no effect in practice: decode_bmp_v5_dib() is the last
thing called with the streamer object (...the streamer is passed
to set_dib_bitmasks(), but that doesn't read anything off it except
for DIBType::Info bitmaps, which v5 bitmaps aren't).

But dib_size is 16 larger for v5 than for v4, so we should read
16 bytes.

This is also useful for a hypothetical person who might look at
the reading code to figure out how the writing code should look like.
This commit is contained in:
Nico Weber 2023-03-15 13:34:31 +01:00 committed by Linus Groh
parent 8d3ab2de56
commit e37000b1ea

View file

@ -805,6 +805,7 @@ static bool decode_bmp_v5_dib(BMPLoadingContext& context, InputStreamer& streame
v5.intent = streamer.read_u32();
v5.profile_data = streamer.read_u32();
v5.profile_size = streamer.read_u32();
streamer.drop_bytes(4); // Ignore reserved field.
if constexpr (BMP_DEBUG) {
dbgln("BMP intent: {}", v5.intent);