Skip to content

Commit

Permalink
va: fix handling when all wayland backends fail
Browse files Browse the repository at this point in the history
when all backend failed vaGetDisplayWl will just return a context that
was already destroyed. This leads to crashes if downstream tries to use
the context.
  • Loading branch information
shironeko authored and tleydxdy committed Jan 10, 2024
1 parent 3457aa8 commit 20fa2d4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions va/wayland/va_wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ vaGetDisplayWl(struct wl_display *display)

for (i = 0; g_backends[i].create != NULL; i++) {
if (g_backends[i].create(pDisplayContext))
break;
return (VADisplay)pDisplayContext;
g_backends[i].destroy(pDisplayContext);
}

return (VADisplay)pDisplayContext;

error:
va_DisplayContextDestroy(pDisplayContext);
return NULL;
Expand Down

0 comments on commit 20fa2d4

Please sign in to comment.