wayland: Fix incorrect dereference when sorting icon surfaces

(cherry picked from commit 2f1cf4629c)
This commit is contained in:
Frank Praznik
2026-06-30 10:15:28 -04:00
parent 25e2ec0407
commit 6f0544dcca
2 changed files with 4 additions and 4 deletions

View File

@@ -717,8 +717,8 @@ static bool Wayland_GetSystemCursor(SDL_CursorData *cdata, SDL_WaylandCursorStat
static int surface_sort_callback(const void *a, const void *b)
{
SDL_Surface *s1 = *(SDL_Surface **)a;
SDL_Surface *s2 = *(SDL_Surface **)b;
const SDL_Surface *s1 = *(const SDL_Surface **)a;
const SDL_Surface *s2 = *(const SDL_Surface **)b;
return (s1->w * s1->h) <= (s2->w * s2->h) ? -1 : 1;
}

View File

@@ -3026,8 +3026,8 @@ void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
static int icon_sort_callback(const void *a, const void *b)
{
SDL_Surface *s1 = (SDL_Surface *)a;
SDL_Surface *s2 = (SDL_Surface *)b;
const SDL_Surface *s1 = *(const SDL_Surface **)a;
const SDL_Surface *s2 = *(const SDL_Surface **)b;
return (s1->w * s1->h) <= (s2->w * s2->h) ? -1 : 1;
}