SDL: Fixed bug #8897 - SDL_BlitSurface segfault when dest_rect is null

From 237535b23af996cf307e2d28848f1c3e9df8588c Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Mon, 22 Jan 2024 09:22:41 +0100
Subject: [PATCH] Fixed bug #8897 - SDL_BlitSurface segfault when dest_rect is
 null

---
 src/video/SDL_surface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c
index 0306f8fc95df..9db0c5039cfc 100644
--- a/src/video/SDL_surface.c
+++ b/src/video/SDL_surface.c
@@ -772,7 +772,7 @@ int SDL_UpperBlit(SDL_Surface *src, const SDL_Rect *srcrect,
         if (dstrect) { /* update output parameter */
             *dstrect = r_dst;
         }
-        return SDL_LowerBlit(src, &r_src, dst, dstrect);
+        return SDL_LowerBlit(src, &r_src, dst, &r_dst);
     }
 
 end: