aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2021-02-13 14:03:46 +0100
committerAndre Weissflog <floooh@gmail.com>2021-02-13 14:03:46 +0100
commitd517370916ffd388d0c068c0b7918aa62a7b7ec3 (patch)
tree054472f9d25a27f2cd3c59ce5ef6649f0716d3f6 /util
parenteb881913cb629c963f4de2a4bcd4086625cb6a40 (diff)
sokol_nuklear.h: fix a clang analyzer warning (non-critical)
Diffstat (limited to 'util')
-rw-r--r--util/sokol_nuklear.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/sokol_nuklear.h b/util/sokol_nuklear.h
index 8f7ad76f..e7e33bc0 100644
--- a/util/sokol_nuklear.h
+++ b/util/sokol_nuklear.h
@@ -1698,11 +1698,12 @@ SOKOL_API_IMPL void snk_setup(const snk_desc_t* desc) {
/* Font Texture */
if(!_snuklear.desc.no_default_font) {
- int font_width, font_height;
+ int font_width = 0, font_height = 0;
nk_font_atlas_init_default(&_snuklear.atlas);
nk_font_atlas_begin(&_snuklear.atlas);
const void* pixels = nk_font_atlas_bake(&_snuklear.atlas, &font_width, &font_height, NK_FONT_ATLAS_RGBA32);
+ SOKOL_ASSERT((font_width > 0) && (font_height > 0));
_snuklear.img = sg_make_image(&(sg_image_desc){
.width = font_width,
.height = font_height,