Fix BMP loader incorrectly interpreting color table size
Color table should exist for images with bit count <= 8. Importing 16-bit
BMP images could also likely have a color table but they're not currently
supported in Godot.
(cherry picked from commit d5c5aabbf2
)
This commit is contained in:
parent
5dd3d3dadf
commit
f8dce7ade9
|
@ -257,8 +257,8 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
|
||||||
if (bmp_header.bmp_info_header.bmp_bit_count <= 8) {
|
if (bmp_header.bmp_info_header.bmp_bit_count <= 8) {
|
||||||
// Support 256 colors max
|
// Support 256 colors max
|
||||||
color_table_size = 1 << bmp_header.bmp_info_header.bmp_bit_count;
|
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;
|
PoolVector<uint8_t> bmp_color_table;
|
||||||
if (color_table_size > 0) {
|
if (color_table_size > 0) {
|
||||||
|
|
Loading…
Reference in New Issue