From 02aa4f5e288be0f932f859c7bc0b878b35710cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 24 Nov 2023 00:08:47 +0100 Subject: [PATCH] vaapi: add missing NULL check ctx->destroy_native_ctx is guarded, but this early exit was not. --- video/vaapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/vaapi.c b/video/vaapi.c index 2af1be4981..7997da2b2f 100644 --- a/video/vaapi.c +++ b/video/vaapi.c @@ -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;