From 1eb8ff5e54d73365997fec442103e686aaed1d90 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 22 Sep 2024 18:05:58 +0200 Subject: [PATCH] `LoadFontDefault()`: Initialize glyphs and recs to zero #4319 --- src/rtext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 34b6fcedb..e4c89d5f1 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -260,8 +260,8 @@ extern void LoadFontDefault(void) // Allocate space for our characters info data // NOTE: This memory must be freed at end! --> Done by CloseWindow() - defaultFont.glyphs = (GlyphInfo *)RL_MALLOC(defaultFont.glyphCount*sizeof(GlyphInfo)); - defaultFont.recs = (Rectangle *)RL_MALLOC(defaultFont.glyphCount*sizeof(Rectangle)); + defaultFont.glyphs = (GlyphInfo *)RL_CALLOC(defaultFont.glyphCount, sizeof(GlyphInfo)); + defaultFont.recs = (Rectangle *)RL_CALLOC(defaultFont.glyphCount, sizeof(Rectangle)); int currentLine = 0; int currentPosX = charsDivisor;