Skip to content

Commit

Permalink
va: fix the fd leak issue caused by vaInitialize failure
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Zhang <[email protected]>
  • Loading branch information
XinfengZhang committed Sep 18, 2023
1 parent 8575b2b commit 931387e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions va/va.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,11 @@ VAStatus vaInitialize(

vaStatus = va_new_opendriver(dpy);

if (VA_STATUS_SUCCESS != vaStatus) {
VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
pDisplayContext->vaDestroy(pDisplayContext);
}

*major_version = VA_MAJOR_VERSION;
*minor_version = VA_MINOR_VERSION;

Expand Down

0 comments on commit 931387e

Please sign in to comment.