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.
pull/389/head
Lynne 1 year ago
parent 58f82fc26a
commit bae92361ed
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
  1. 5
      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);
}

Loading…
Cancel
Save