(PS3 image) Some more safety checks

(Driver) Safety check before invoking menu_context_destroy
This commit is contained in:
twinaphex 2014-06-02 18:08:08 +02:00
parent 30ce741f98
commit 8e04ac2f12
2 changed files with 3 additions and 1 deletions

View File

@ -635,7 +635,7 @@ void uninit_drivers(void)
if (g_extern.system.hw_render_callback.context_destroy && !driver.video_cache_context)
g_extern.system.hw_render_callback.context_destroy();
if (driver.menu_ctx && driver.menu_ctx->context_destroy)
if (driver.menu && driver.menu_ctx && driver.menu_ctx->context_destroy)
driver.menu_ctx->context_destroy(driver.menu);
#ifdef HAVE_MENU

View File

@ -329,6 +329,8 @@ bool texture_image_load(void *data, const char *path, void *image_data)
void texture_image_free(void *data, void *image_data)
{
struct texture_image *img = (struct texture_image*)image_data;
if (!img)
return;
if (img->pixels)
free(img->pixels);