libobs: Handle empty path in os_get_path_extension

os_readdir might return an empty path if the OS filename doesn't fit
into the buffer after os_wcs_to_utf8. If this empty path is then passed
to os_get_path_extension it causes a crash.
This commit is contained in:
Richard Stanway 2020-02-25 21:28:24 +01:00
parent 267874ad92
commit 269ebd2983

View File

@ -653,6 +653,9 @@ const char *os_get_path_extension(const char *path)
char *period;
char *slash;
if (!path[0])
return NULL;
dstr_init_copy(&temp, path);
dstr_replace(&temp, "\\", "/");