vaapi: add missing NULL check

ctx->destroy_native_ctx is guarded, but this early exit was not.
This commit is contained in:
Kacper Michajłow 2023-11-24 00:08:47 +01:00 committed by sfan5
parent 6898d57d98
commit 02aa4f5e28
1 changed files with 2 additions and 1 deletions

View File

@ -316,7 +316,8 @@ static struct AVBufferRef *va_create_standalone(struct mpv_global *global,
va_initialize(display, log, params->probing);
if (!ctx) {
vaTerminate(display);
native_displays[n]->destroy(native_ctx);
if (native_displays[n]->destroy)
native_displays[n]->destroy(native_ctx);
goto end;
}
ctx->native_ctx = native_ctx;