summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/BMPLoader.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-03-15 13:34:31 +0100
committerLinus Groh <mail@linusgroh.de>2023-03-15 13:54:09 +0000
commite37000b1ea8350fe24b18cdd5acc17b567b668cc (patch)
tree1cdb0948857a20c93d2c1e3b13943d8299d24ca3 /Userland/Libraries/LibGfx/BMPLoader.cpp
parent8d3ab2de5689bbc1093a5eabb50f02a09f222fd7 (diff)
downloadserenity-e37000b1ea8350fe24b18cdd5acc17b567b668cc.zip
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.
Diffstat (limited to 'Userland/Libraries/LibGfx/BMPLoader.cpp')
-rw-r--r--Userland/Libraries/LibGfx/BMPLoader.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/BMPLoader.cpp b/Userland/Libraries/LibGfx/BMPLoader.cpp
index 7abfffad81..bae791c339 100644
--- a/Userland/Libraries/LibGfx/BMPLoader.cpp
+++ b/Userland/Libraries/LibGfx/BMPLoader.cpp
@@ -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);