Merge pull request #30634 from Xrayez/fix-bmp-table-assertion

Fix BMP loader incorrectly interpreting color table size
This commit is contained in:
Rémi Verschelde 2019-07-17 10:44:24 +02:00 committed by GitHub
commit c59c2871a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]