From ed387d00aaaee50ef7d4dc2f355123e16c7727ca Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 8 Aug 2016 17:21:46 +0200 Subject: [PATCH] Corrected issue with VS --- src/text.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/text.c b/src/text.c index d6a44bec..2f347b5d 100644 --- a/src/text.c +++ b/src/text.c @@ -859,7 +859,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int unsigned char *ttfBuffer = (unsigned char *)malloc(1 << 25); unsigned char *dataBitmap = (unsigned char *)malloc(FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT*sizeof(unsigned char)); // One channel bitmap returned! - stbtt_bakedchar charData[numChars]; + stbtt_bakedchar *charData = (stbtt_bakedchar *)malloc(sizeof(stbtt_bakedchar)*numChars); SpriteFont font = { 0 }; @@ -922,6 +922,8 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int font.charOffsets[i] = (Vector2){ charData[i].xoff, charData[i].yoff }; font.charAdvanceX[i] = (int)charData[i].xadvance; } + + free(charData); return font; } \ No newline at end of file