Commit 0adb67017b76086da909382a632b288e17cf5848

pionere 2022-04-12T09:01:17

avoid NullPointer in SDL_GetRenderTarget

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 9bb953e..1068150 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -2263,6 +2263,8 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
 SDL_Texture *
 SDL_GetRenderTarget(SDL_Renderer *renderer)
 {
+    CHECK_RENDERER_MAGIC(renderer, NULL);
+
     return renderer->target;
 }