Skip to content

Commit

Permalink
Merge pull request godotengine#30634 from Xrayez/fix-bmp-table-assertion
Browse files Browse the repository at this point in the history
Fix BMP loader incorrectly interpreting color table size
  • Loading branch information
akien-mga authored Jul 17, 2019
2 parents e30a137 + d5c5aab commit c59c287
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/bmp/image_loader_bmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
if (bmp_header.bmp_info_header.bmp_bit_count <= 8) {
// Support 256 colors max
color_table_size = 1 << bmp_header.bmp_info_header.bmp_bit_count;
ERR_FAIL_COND_V(color_table_size == 0, ERR_BUG);
}
ERR_FAIL_COND_V(color_table_size == 0, ERR_BUG);

PoolVector<uint8_t> bmp_color_table;
// Color table is usually 4 bytes per color -> [B][G][R][0]
Expand Down

0 comments on commit c59c287

Please sign in to comment.