mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
Prevent immediate crash when compiling with SANITIZER=address
This commit is contained in:
parent
3fbed8df27
commit
857562bf9d
@ -487,19 +487,20 @@ bool video_shader_resolve_parameters(config_file_t *conf,
|
||||
|
||||
for (i = 0; i < shader->passes; i++)
|
||||
{
|
||||
char line[4096];
|
||||
RFILE *file = NULL;
|
||||
const char *path = shader->pass[i].source.path;
|
||||
#ifdef HAVE_SLANG
|
||||
/* First try to use the more robust slang implementation to support #includes. */
|
||||
/* FIXME: The check for slang can be removed if it's sufficiently tested for
|
||||
* GLSL/Cg as well, it should be the same implementation. */
|
||||
if ((string_is_equal_fast(path_get_extension(shader->pass[i].source.path), "slang", 5)) &&
|
||||
if (!string_is_empty(path) && (string_is_equal_fast(path_get_extension(path), "slang", 5)) &&
|
||||
slang_preprocess_parse_parameters(shader->pass[i].source.path, shader))
|
||||
continue;
|
||||
/* If that doesn't work, fallback to the old path.
|
||||
* Ideally, we'd get rid of this path sooner or later. */
|
||||
#endif
|
||||
|
||||
char line[4096];
|
||||
RFILE *file = filestream_open(shader->pass[i].source.path, RFILE_MODE_READ_TEXT, -1);
|
||||
file = filestream_open(shader->pass[i].source.path, RFILE_MODE_READ_TEXT, -1);
|
||||
|
||||
if (!file)
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user