aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vulkan_decode.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2023-05-29 02:04:59 +0200
committerLynne <dev@lynne.ee>2023-05-29 03:23:06 +0200
commitbae92361ed130aef1bada7c59eb67393510e0f1a (patch)
tree9aba45d4b39e3a369cbe174f4145568502b2407a /libavcodec/vulkan_decode.c
parent58f82fc26a67c32586e635b67efc523ab9755b18 (diff)
downloadffmpeg-bae92361ed130aef1bada7c59eb67393510e0f1a.tar.gz
vulkan_decode: check if yuv_sampler exists before freeing it
This prevents multiple NULL accesses - if yuv_sampler exists, then everything required for it to be destroyed also exists.
Diffstat (limited to 'libavcodec/vulkan_decode.c')
-rw-r--r--libavcodec/vulkan_decode.c5
1 files changed, 3 insertions, 2 deletions
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);
}