1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

vulkan_decode: allow using NULL sequence_params when decoding

The function had some checks to allow for this, but as it always tried
to dereference a bufferref, it wasn't fully ready.
This commit is contained in:
Lynne
2025-03-27 12:47:11 +00:00
parent 4dadf71dce
commit 5fc4acae9c

View File

@ -96,11 +96,9 @@ int ff_vk_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
av_refstruct_replace(&dst_ctx->shared_ctx, src_ctx->shared_ctx);
if (src_ctx->session_params) {
err = av_buffer_replace(&dst_ctx->session_params, src_ctx->session_params);
if (err < 0)
return err;
}
dst_ctx->dedicated_dpb = src_ctx->dedicated_dpb;
dst_ctx->external_fg = src_ctx->external_fg;
@ -381,11 +379,12 @@ int ff_vk_decode_frame(AVCodecContext *avctx,
/* Quirks */
const int layered_dpb = ctx->common.layered_dpb;
VkVideoSessionParametersKHR *par = (VkVideoSessionParametersKHR *)dec->session_params->data;
VkVideoBeginCodingInfoKHR decode_start = {
.sType = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR,
.videoSession = ctx->common.session,
.videoSessionParameters = *par,
.videoSessionParameters = dec->session_params ?
*((VkVideoSessionParametersKHR *)dec->session_params->data) :
VK_NULL_HANDLE,
.referenceSlotCount = vp->decode_info.referenceSlotCount,
.pReferenceSlots = vp->decode_info.pReferenceSlots,
};