SDL: Actually return an error when the surface is invalid

From 065ec2d51897a533d635a6fb1948aa23d5d56279 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 5 Jul 2024 08:12:05 -0700
Subject: [PATCH] Actually return an error when the surface is invalid

---
 src/render/SDL_render.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index f1c72d3c1d813..b880f6fba5f83 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -1159,6 +1159,7 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface)
 
 	if (!surface) {
         SDL_InvalidParamError("surface");
+		return NULL;
 	}
 
     SDL_PropertiesID props = SDL_CreateProperties();