Fix segfault when non-existent font specified

This commit is contained in:
Nunuhara Cabbage
2020-07-10 23:43:46 -07:00
parent 1cd949f597
commit aa87e3e8c0
+4
View File
@@ -73,6 +73,8 @@ static agsurface_t *font_sdlttf_get_glyph(const unsigned char *msg) {
static SDL_Surface *fs;
static agsurface_t result;
if (!fontset)
return NULL;
if (fs) {
SDL_FreeSurface(fs);
fs = NULL;
@@ -148,6 +150,8 @@ static int font_sdlttf_draw_glyph(int x, int y, const unsigned char *str, int cl
if (!*str)
return 0;
if (!fontset)
return 0;
conv = sjis2lang(str);
if (this->antialiase_on) {