From cac4e31261708e4b736f45d667e85a96ca8a427e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 8 Dec 2017 11:34:32 -0800 Subject: [PATCH] Added check for failure of D3D_ActivateRenderer() --- src/render/direct3d/SDL_render_d3d.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index a6e2aeec1..2c67894c3 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -1077,7 +1077,9 @@ D3D_SetRenderTargetInternal(SDL_Renderer * renderer, SDL_Texture * texture) static int D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) { - D3D_ActivateRenderer(renderer); + if (D3D_ActivateRenderer(renderer) < 0) { + return -1; + } return D3D_SetRenderTargetInternal(renderer, texture); }