diff --git a/driver.c b/driver.c index 6a759cbee7..640630d51f 100644 --- a/driver.c +++ b/driver.c @@ -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 diff --git a/gfx/image/image_ps3.c b/gfx/image/image_ps3.c index 59a5ad8c31..fe2dcd85e7 100644 --- a/gfx/image/image_ps3.c +++ b/gfx/image/image_ps3.c @@ -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);