render/wiiu: Safety checks on SDL_DestroyTexture

This commit is contained in:
Ash 2018-11-06 21:12:17 +11:00 committed by Ash Logan
parent 6679bae15a
commit 9c5dbf0404

View File

@ -135,7 +135,9 @@ int WIIU_SDL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
void WIIU_SDL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
{
WIIU_TextureData *tdata = (WIIU_TextureData *) texture->driverdata;
WIIU_TextureData *tdata;
if (texture == NULL || texture->driverdata == NULL) return;
tdata = (WIIU_TextureData *) texture->driverdata;
free(tdata->texture.surface.image);
SDL_free(tdata);
}