diff --git a/gfx/common/d3d9_common.c b/gfx/common/d3d9_common.c index d71a4ceb18..21f279dc48 100644 --- a/gfx/common/d3d9_common.c +++ b/gfx/common/d3d9_common.c @@ -588,7 +588,10 @@ void d3d9x_constant_table_set_defaults(LPDIRECT3DDEVICE9 dev, #if defined(HAVE_D3DX) LPD3DXCONSTANTTABLE consttbl = (LPD3DXCONSTANTTABLE)p; if (consttbl && dev) - consttbl->lpVtbl->SetDefaults(consttbl, dev); + { + if (consttbl->lpVtbl->SetDefaults) + consttbl->lpVtbl->SetDefaults(consttbl, dev); + } #endif } diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 75bc3bdfb0..2d7b2e23ec 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -378,13 +378,15 @@ const char *path_get_extension(const char *path) * path_remove_extension: * @path : path * - * Removes the extension from the path and returns the result. - * Removes all text after and including the last '.'. + * Mutates path by removing its extension. Removes all + * text after and including the last '.'. * Only '.'s after the last slash are considered. * - * Returns: path with the extension part removed. - * If there is no extension at the end of path, - * returns a pointer to the unaltered original path. + * Returns: + * 1) If path has an extension, returns path with the + * extension removed. + * 2) If there is no extension, returns NULL. + * 3) If path is empty or NULL, returns NULL */ char *path_remove_extension(char *path) { diff --git a/libretro-common/include/file/file_path.h b/libretro-common/include/file/file_path.h index 89321c8f80..026b4f7933 100644 --- a/libretro-common/include/file/file_path.h +++ b/libretro-common/include/file/file_path.h @@ -100,11 +100,15 @@ const char *path_get_extension(const char *path); * path_remove_extension: * @path : path * - * Removes the extension from the path and returns the result. - * Removes all text after and including the last '.'. + * Mutates path by removing its extension. Removes all + * text after and including the last '.'. * Only '.'s after the last slash are considered. * - * Returns: path with the extension part removed. + * Returns: + * 1) If path has an extension, returns path with the + * extension removed. + * 2) If there is no extension, returns NULL. + * 3) If path is empty or NULL, returns NULL */ char *path_remove_extension(char *path);