Skip to content

Commit 17dcf87

Browse files
committed
Core (LV::Video): Fix BMP loader not loading palette from the correct offset.
1 parent 3132dfb commit 17dcf87

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libvisual/libvisual/private/lv_video_bmp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ namespace LV {
286286
fp.read (reinterpret_cast<char*> (&bf_bits), 4);
287287
bf_bits = VISUAL_ENDIAN_LEI32 (bf_bits);
288288

289+
auto dib_header_pos = fp.tellg ();
290+
289291
/* Read the info structure size */
290292
fp.read (reinterpret_cast<char*> (&bi_size), 4);
291293
bi_size = VISUAL_ENDIAN_LEI32 (bi_size);
@@ -347,6 +349,8 @@ namespace LV {
347349
return nullptr;
348350
}
349351

352+
fp.seekg (dib_header_pos + std::streampos {bi_size}, std::ios::beg);
353+
350354
/* Load the palette */
351355
if (bi_bitcount < 24) {
352356
if (bi_clrused == 0) {

0 commit comments

Comments
 (0)