Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core (LV::Video): Additional comments in BMP loader on color table re…
Browse files Browse the repository at this point in the history
…ading.
kaixiong committed Jan 25, 2025
1 parent 54a9d7e commit 175e9b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libvisual/libvisual/private/lv_video_bmp.cpp
Original file line number Diff line number Diff line change
@@ -352,9 +352,13 @@ namespace LV {
return nullptr;
}

/* Load the palette */

/* Skip past DIB header to color table */
/* BI_BITFIELDS and BI_ALPHABITFIELDS are unsupported, so there are
no bitmasks after the DIB header. */
fp.seekg (dib_header_pos + std::streampos {bi_size}, std::ios::beg);

/* Load the palette */
if (bi_bitcount < 24) {
if (bi_clrused == 0) {
/* When the colors used variable is zero, use the
@@ -392,6 +396,8 @@ namespace LV {
if (palette)
video->set_palette (*palette);

/* Read and decode image data */

/* Set to the beginning of image data, note that MickeySoft likes stuff upside down .. */
fp.seekg (bf_bits, std::ios::beg);

0 comments on commit 175e9b2

Please sign in to comment.