diff options
| author | Skabunkel <> | 2019-02-24 01:48:29 +0100 |
|---|---|---|
| committer | Skabunkel <> | 2019-02-24 01:48:29 +0100 |
| commit | f2d5cddfc8076fb3a0e9618bbd0c51a40b2b0922 (patch) | |
| tree | 02680c51a1fb451db6de2905df73aa7d3afeb520 /src | |
| parent | 56c79a10de02781a198224216ea57bc1922fd0ff (diff) | |
| download | raylib-f2d5cddfc8076fb3a0e9618bbd0c51a40b2b0922.tar.gz raylib-f2d5cddfc8076fb3a0e9618bbd0c51a40b2b0922.zip | |
Fixed segmentation fult created by quick fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/text.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -430,6 +430,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) spriteFont.chars[i].offsetX = 0; spriteFont.chars[i].offsetY = 0; spriteFont.chars[i].advanceX = 0; + spriteFont.chars[i].data = NULL; } spriteFont.baseSize = (int)spriteFont.chars[0].rec.height; @@ -686,7 +687,8 @@ void UnloadFont(Font font) { for (int i = 0; i < font.charsCount; i++) { - free(font.chars[i].data); + if(font.chars[i].data != NULL) + free(font.chars[i].data); } UnloadTexture(font.texture); free(font.chars); @@ -1442,6 +1444,7 @@ static Font LoadBMFont(const char *fileName) font.chars[i].offsetX = charOffsetX; font.chars[i].offsetY = charOffsetY; font.chars[i].advanceX = charAdvanceX; + font.chars[i].data = NULL; } fclose(fntFile); |
