Skip to content

Commit

Permalink
obs-ffmpeg: Close VAAPI device on vaInitialize fail
Browse files Browse the repository at this point in the history
On some systems (eg. mine), VAAPI fails on vaInitialize. Valgrind was
able to spot that the device was not being closed, and it appears to
have been correct. This fixes a memory leak.
  • Loading branch information
tt2468 committed Jun 20, 2024
1 parent 6457d7b commit 6c38927
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/obs-ffmpeg/vaapi-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ VADisplay vaapi_open_device(int *fd, const char *device_path,
if (va_status != VA_STATUS_SUCCESS) {
blog(LOG_ERROR, "VAAPI: Failed to initialize display in %s",
func_name);
vaapi_close_device(fd, va_dpy);
return NULL;
}

Expand Down

0 comments on commit 6c38927

Please sign in to comment.