summaryrefslogtreecommitdiff
path: root/modules/bmp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-17 10:44:24 +0200
committerGitHub <noreply@github.com>2019-07-17 10:44:24 +0200
commitc59c2871a220f7251b9cb3ba5a59535f8a20bd1e (patch)
tree86ab9ff87f390826a6d1195a46f39abc09370846 /modules/bmp
parente30a137548dce0fe1f5eda223b900fcbdd2631b8 (diff)
parentd5c5aabbf28bdae7e7b5e2be0b66f640a0cd62cf (diff)
Merge pull request #30634 from Xrayez/fix-bmp-table-assertion
Fix BMP loader incorrectly interpreting color table size
Diffstat (limited to 'modules/bmp')
-rw-r--r--modules/bmp/image_loader_bmp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp
index a7e8dec11e..bd7aeeebeb 100644
--- a/modules/bmp/image_loader_bmp.cpp
+++ b/modules/bmp/image_loader_bmp.cpp
@@ -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]