From fb6b605be128c721c3db8b6135f1e3e8177f3faa Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 7 Aug 2023 22:53:16 -0700
Subject: [PATCH] Fixed testautomation --filter
video_getNumDisplayModesNegative
---
src/sdl2_compat.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index e698ce3..d3edc8f 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -4480,8 +4480,11 @@ SDL_GetNumDisplayModes(int displayIndex)
int count = 0;
const SDL_DisplayMode **list;
list = SDL3_GetFullscreenDisplayModes(displayID, &count);
- SDL3_free((void *)list);
- return count;
+ if (list) {
+ SDL3_free(list);
+ return count;
+ }
+ return -1;
}
DECLSPEC int SDLCALL