mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
(SBT font driver) Check first if font files exist before
we try to open them
This commit is contained in:
parent
0dc73f2c8e
commit
714e3ddc2a
3 changed files with 2 additions and 4 deletions
|
@ -151,7 +151,7 @@ static void *font_renderer_stb_init(const char *font_path, float font_size)
|
|||
if (!self)
|
||||
goto error;
|
||||
|
||||
if (!filestream_read_file(font_path, (void**)&font_data, NULL))
|
||||
if (!path_is_valid(font_path) || !filestream_read_file(font_path, (void**)&font_data, NULL))
|
||||
goto error;
|
||||
|
||||
if (!font_renderer_stb_create_atlas(self, font_data, font_size, 512, 512))
|
||||
|
|
|
@ -245,7 +245,7 @@ static void *font_renderer_stb_unicode_init(const char *font_path, float font_si
|
|||
}
|
||||
else
|
||||
#endif
|
||||
if (!filestream_read_file(font_path, (void**)&self->font_data, NULL))
|
||||
if (!path_is_valid(font_path) || !filestream_read_file(font_path, (void**)&self->font_data, NULL))
|
||||
goto error;
|
||||
|
||||
if (!stbtt_InitFont(&self->info, self->font_data,
|
||||
|
|
|
@ -687,13 +687,11 @@ char *video_shader_read_reference_path(const char *path)
|
|||
* which we will load as config_file_new_from_path_to_string(<path to config>).
|
||||
*/
|
||||
char *reference = NULL;
|
||||
config_file_t *conf = NULL;
|
||||
RFILE *file = NULL;
|
||||
char *line = NULL;
|
||||
|
||||
if (string_is_empty(path))
|
||||
goto end;
|
||||
|
||||
if (!path_is_valid(path))
|
||||
goto end;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue