Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

@evelikov evelikov Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is a good idea for a few of reasons:

  • on error we should not be touching out variables
  • on error we're leaking the state setup via va_TraceInit - pre-existing issue
  • as-is on vaInitialize() failure, state set in vaGetDisplay*() will be removed, which is fairly assummetrical and off IMHO

}

*major_version = VA_MAJOR_VERSION;
*minor_version = VA_MINOR_VERSION;

Expand Down