From fb9cda3712a6fb620b54c0abea27127440d3d447 Mon Sep 17 00:00:00 2001 From: rw-r-r-0644 Date: Mon, 18 Mar 2019 22:43:01 +0100 Subject: [PATCH] render/wiiu: Reintroduce check removed with fd92b81 to fix crashes --- src/render/wiiu/SDL_rtexture_wiiu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/render/wiiu/SDL_rtexture_wiiu.c b/src/render/wiiu/SDL_rtexture_wiiu.c index e57e5b10b..e06a71921 100644 --- a/src/render/wiiu/SDL_rtexture_wiiu.c +++ b/src/render/wiiu/SDL_rtexture_wiiu.c @@ -199,8 +199,15 @@ int WIIU_SDL_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture) void WIIU_SDL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) { - WIIU_RenderData *data = (WIIU_RenderData *) renderer->driverdata; - WIIU_TextureData *tdata = (WIIU_TextureData *) texture->driverdata; + WIIU_RenderData *data; + WIIU_TextureData *tdata; + + if (texture == NULL || texture->driverdata == NULL) { + return; + } + + data = (WIIU_RenderData *) renderer->driverdata; + tdata = (WIIU_TextureData *) texture->driverdata; /* Wait for the texture rendering to finish */ WIIU_TextureCheckWaitRendering(data, tdata);