From c560f1c71b39ed1e90732dec4cbb289737c6c2d8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 17 Jul 2016 15:58:14 +0200 Subject: [PATCH] Use return value of image_texture_load --- menu/drivers/xmb.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 2cb7165b26..edf608b1d4 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1370,25 +1370,29 @@ static void xmb_context_reset_horizontal_list( "-content.png", sizeof(content_texturepath)); - image_texture_load(&ti, texturepath); - - if(ti.pixels) { - video_driver_texture_unload(&node->icon); - video_driver_texture_load(&ti, - TEXTURE_FILTER_MIPMAP_LINEAR, &node->icon); + if (image_texture_load(&ti, texturepath)) + { + if(ti.pixels) + { + video_driver_texture_unload(&node->icon); + video_driver_texture_load(&ti, + TEXTURE_FILTER_MIPMAP_LINEAR, &node->icon); + } + + image_texture_free(&ti); } - image_texture_free(&ti); + if (image_texture_load(&ti, content_texturepath)) + { + if(ti.pixels) + { + video_driver_texture_unload(&node->content_icon); + video_driver_texture_load(&ti, + TEXTURE_FILTER_MIPMAP_LINEAR, &node->content_icon); + } - image_texture_load(&ti, content_texturepath); - - if(ti.pixels) { - video_driver_texture_unload(&node->content_icon); - video_driver_texture_load(&ti, - TEXTURE_FILTER_MIPMAP_LINEAR, &node->content_icon); + image_texture_free(&ti); } - - image_texture_free(&ti); } xmb_toggle_horizontal_list(xmb);