sdl12-compat: video: SDL_UpperBlit should reject surfaces with NULL pixels.

From c549425b8d8e4d67e5412ffe84ab47d3aee1bcc3 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Wed, 19 Oct 2022 13:17:38 -0400
Subject: [PATCH] video: SDL_UpperBlit should reject surfaces with NULL pixels.

Fixes #264.
---
 src/SDL12_compat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 9db296e49..8dfdf4f9b 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -6328,6 +6328,8 @@ SDL_UpperBlit(SDL12_Surface *src12, SDL12_Rect *srcrect12, SDL12_Surface *dst12,
 
     if ((src12 == NULL) || (dst12 == NULL)) {
         return SDL20_SetError("SDL_UpperBlit: passed a NULL surface");
+    } else if ((src12->pixels == NULL) || (dst12->pixels == NULL)) {
+        return SDL20_SetError("SDL_UpperBlit: passed a surface with NULL pixels");
     } else if (SaveDestAlpha(src12, dst12, dstrect12, &dstalpha) < 0) {
         return -1;
     }