diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c index 1d1fb9ad97..6138106fef 100644 --- a/libavcodec/vulkan_decode.c +++ b/libavcodec/vulkan_decode.c @@ -581,8 +581,9 @@ static void free_common(void *opaque, uint8_t *data) ff_vk_video_common_uninit(s, &ctx->common); - vk->DestroySamplerYcbcrConversion(s->hwctx->act_dev, ctx->yuv_sampler, - s->hwctx->alloc); + if (ctx->yuv_sampler) + vk->DestroySamplerYcbcrConversion(s->hwctx->act_dev, ctx->yuv_sampler, + s->hwctx->alloc); ff_vk_uninit(s); }