Skip to content

Commit b8c7eed

Browse files
tleydxdyXinfengZhang
authored andcommitted
va: fix handling when all wayland backends fail
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.
1 parent 3457aa8 commit b8c7eed

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

va/wayland/va_wayland.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,10 @@ vaGetDisplayWl(struct wl_display *display)
133133

134134
for (i = 0; g_backends[i].create != NULL; i++) {
135135
if (g_backends[i].create(pDisplayContext))
136-
break;
136+
return (VADisplay)pDisplayContext;
137137
g_backends[i].destroy(pDisplayContext);
138138
}
139139

140-
return (VADisplay)pDisplayContext;
141-
142140
error:
143141
va_DisplayContextDestroy(pDisplayContext);
144142
return NULL;

0 commit comments

Comments
 (0)