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 | av_refstruct_replace(&dst_ctx->shared_ctx, src_ctx->shared_ctx); | 97 | av_refstruct_replace(&dst_ctx->shared_ctx, src_ctx->shared_ctx); |
| 98 | 98 | ||
| 99 | if (src_ctx->session_params) { | 99 | err = av_buffer_replace(&dst_ctx->session_params, src_ctx->session_params); |
| 100 | err = av_buffer_replace(&dst_ctx->session_params, src_ctx->session_params); | 100 | if (err < 0) |
| 101 | if (err < 0) | 101 | return err; |
| 102 | return err; | ||
| 103 | } | ||
| 104 | 102 | ||
| 105 | dst_ctx->dedicated_dpb = src_ctx->dedicated_dpb; | 103 | dst_ctx->dedicated_dpb = src_ctx->dedicated_dpb; |
| 106 | dst_ctx->external_fg = src_ctx->external_fg; | 104 | dst_ctx->external_fg = src_ctx->external_fg; |
| @@ -381,11 +379,12 @@ int ff_vk_decode_frame(AVCodecContext *avctx, · 274 unmodified lines | |||
| 381 | /* Quirks */ | 379 | /* Quirks */ |
| 382 | const int layered_dpb = ctx->common.layered_dpb; | 380 | const int layered_dpb = ctx->common.layered_dpb; |
| 383 | 381 | ||
| 384 | VkVideoSessionParametersKHR *par = (VkVideoSessionParametersKHR *)dec->session_params->data; | ||
| 385 | VkVideoBeginCodingInfoKHR decode_start = { | 382 | VkVideoBeginCodingInfoKHR decode_start = { |
| 386 | .sType = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR, | 383 | .sType = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR, |
| 387 | .videoSession = ctx->common.session, | 384 | .videoSession = ctx->common.session, |
| 388 | .videoSessionParameters = *par, | 385 | .videoSessionParameters = dec->session_params ? |
| 386 | *((VkVideoSessionParametersKHR *)dec->session_params->data) : | ||
| 387 | VK_NULL_HANDLE, | ||
| 389 | .referenceSlotCount = vp->decode_info.referenceSlotCount, | 388 | .referenceSlotCount = vp->decode_info.referenceSlotCount, |
| 390 | .pReferenceSlots = vp->decode_info.pReferenceSlots, | 389 | .pReferenceSlots = vp->decode_info.pReferenceSlots, |
| 391 | }; | 390 | }; |