diff options
author | Lynne <dev@lynne.ee> | 2023-05-29 02:04:59 +0200 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-05-29 03:23:06 +0200 |
commit | bae92361ed130aef1bada7c59eb67393510e0f1a (patch) | |
tree | 9aba45d4b39e3a369cbe174f4145568502b2407a /libavcodec/vulkan_decode.c | |
parent | 58f82fc26a67c32586e635b67efc523ab9755b18 (diff) | |
download | ffmpeg-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.c | 5 |
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); } |