mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibGfx: Recognize incomplete BMP colormaps
This commit is contained in:
parent
a4b207e04f
commit
031814796e
1 changed files with 4 additions and 0 deletions
|
@ -861,8 +861,12 @@ static bool decode_bmp_color_table(BMPLoadingContext& context)
|
|||
Streamer streamer(context.data + bmp_header_size + context.dib_size(), size_of_color_table);
|
||||
for (u32 i = 0; !streamer.at_end() && i < max_colors; ++i) {
|
||||
if (bytes_per_color == 4) {
|
||||
if (!streamer.has_u32())
|
||||
return false;
|
||||
context.color_table.append(streamer.read_u32());
|
||||
} else {
|
||||
if (!streamer.has_u24())
|
||||
return false;
|
||||
context.color_table.append(streamer.read_u24());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue