haiku: fix modelist double-free

This commit is contained in:
erysdren
2026-01-07 00:49:56 -06:00
committed by Ryan C. Gordon
parent f805bb53cf
commit 8b47487547

View File

@@ -245,9 +245,8 @@ bool HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
uint32 count, i;
// Get graphics-hardware supported modes
bscreen.GetModeList(&bmodes, &count);
bscreen.GetMode(&this_bmode);
if (bscreen.GetModeList(&bmodes, &count) == B_OK && bscreen.GetMode(&this_bmode) == B_OK)
{
for (i = 0; i < count; ++i) {
// FIXME: Apparently there are errors with colorspace changes
if (bmodes[i].space == this_bmode.space) {
@@ -259,6 +258,9 @@ bool HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
return true;
}
return false;
}
bool HAIKU_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
{