Skip to content

Commit

Permalink
wayland: Check the returned display value for null
Browse files Browse the repository at this point in the history
In reality, this condition will never occur, since the index is checked before calling the display retrieval function, but aggressive LTO with jump threading can generate a warning if this isn't explicitly checked.
  • Loading branch information
Kontrabant committed Dec 3, 2024
1 parent e539135 commit 91bb1bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/video/wayland/SDL_waylandvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,11 @@ static void display_handle_done(void *data,

if (driverdata->index > -1) {
dpy = SDL_GetDisplay(driverdata->index);

/* XXX: This can never happen, but jump threading during aggressive LTO can generate a warning without this check. */
if (!dpy) {
dpy = &driverdata->placeholder;
}
} else {
dpy = &driverdata->placeholder;
}
Expand Down

0 comments on commit 91bb1bb

Please sign in to comment.