mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
Fix segfault when non-existent font specified
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user