The function had some checks to allow for this, but as it always tried to dereference a bufferref, it wasn't fully ready.
Unified · Split
| @@ -96,11 +96,9 @@ int ff_vk_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) · 95 unmodified lines | ||
| 96 | 96 | |
| 97 | 97 | av_refstruct_replace(&dst_ctx->shared_ctx, src_ctx->shared_ctx); |
| 98 | 98 | |
| 99 | − if (src_ctx->session_params) { | |
| 100 | − err = av_buffer_replace(&dst_ctx->session_params, src_ctx->session_params); | |
| 101 | − if (err < 0) | |
| 102 | − return err; | |
| 103 | − } | |
| 99 | + err = av_buffer_replace(&dst_ctx->session_params, src_ctx->session_params); | |
| 100 | + if (err < 0) | |
| 101 | + return err; | |
| 104 | 102 | |
| 105 | 103 | dst_ctx->dedicated_dpb = src_ctx->dedicated_dpb; |
| 106 | 104 | dst_ctx->external_fg = src_ctx->external_fg; |
| @@ -381,11 +379,12 @@ int ff_vk_decode_frame(AVCodecContext *avctx, · 274 unmodified lines | ||
| 381 | 379 | /* Quirks */ |
| 382 | 380 | const int layered_dpb = ctx->common.layered_dpb; |
| 383 | 381 | |
| 384 | − VkVideoSessionParametersKHR *par = (VkVideoSessionParametersKHR *)dec->session_params->data; | |
| 385 | 382 | VkVideoBeginCodingInfoKHR decode_start = { |
| 386 | 383 | .sType = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR, |
| 387 | 384 | .videoSession = ctx->common.session, |
| 388 | − .videoSessionParameters = *par, | |
| 385 | + .videoSessionParameters = dec->session_params ? | |
| 386 | + *((VkVideoSessionParametersKHR *)dec->session_params->data) : | |
| 387 | + VK_NULL_HANDLE, | |
| 389 | 388 | .referenceSlotCount = vp->decode_info.referenceSlotCount, |
| 390 | 389 | .pReferenceSlots = vp->decode_info.pReferenceSlots, |
| 391 | 390 | }; |