SDL: Fixed warning C6011: Dereferencing NULL pointer 'viewport'.

From 6ee34380f4f292001adbbd1227847c418ccbb03b Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 4 Dec 2023 21:29:29 -0800
Subject: [PATCH] Fixed warning C6011: Dereferencing NULL pointer 'viewport'.

---
 src/render/software/SDL_render_sw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c
index 1ba010a2e336..591bb89c2a2f 100644
--- a/src/render/software/SDL_render_sw.c
+++ b/src/render/software/SDL_render_sw.c
@@ -643,7 +643,7 @@ static void SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate)
         const SDL_Rect *cliprect = drawstate->cliprect;
         SDL_assert_release(viewport != NULL); /* the higher level should have forced a SDL_RENDERCMD_SETVIEWPORT */
 
-        if (cliprect) {
+        if (cliprect && viewport) {
             SDL_Rect clip_rect;
             clip_rect.x = cliprect->x + viewport->x;
             clip_rect.y = cliprect->y + viewport->y;