direct3d: don't dereference bogus pointer if current texture was destroyed.

Fixes Bugzilla #4460.
Ryan C. Gordon 2019-06-11 09:29:48 -04:00
parent 4392c6ff14
commit 4f59d372f8
1 changed files with 5 additions and 0 deletions

View File

@ -1501,8 +1501,13 @@ D3D_RenderPresent(SDL_Renderer * renderer)
static void static void
D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
{ {
D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata;
D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
if (renderdata->drawstate.texture == texture) {
renderdata->drawstate.texture = NULL;
}
if (!data) { if (!data) {
return; return;
} }