wayland: Check the returned display value for null

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.
This commit is contained in:
Frank Praznik 2024-12-03 11:53:14 -05:00
parent e539135104
commit 91bb1bb6fd
No known key found for this signature in database
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}