Skip to content

Commit

Permalink
direct3d: don't dereference bogus pointer if current texture was dest…
Browse files Browse the repository at this point in the history
…royed.

Fixes Bugzilla #4460.
  • Loading branch information
icculus committed Jun 11, 2019
1 parent 4392c6f commit 4f59d37
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/render/direct3d/SDL_render_d3d.c
Expand Up @@ -1501,8 +1501,13 @@ D3D_RenderPresent(SDL_Renderer * renderer)
static void
D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
{
D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata;
D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;

if (renderdata->drawstate.texture == texture) {
renderdata->drawstate.texture = NULL;
}

if (!data) {
return;
}
Expand Down

0 comments on commit 4f59d37

Please sign in to comment.