Skip to content

Commit aa54da5

Browse files
committed
vulkan_h264: reject end_frame being called without start_frame
Happens for both VAAPI and Vulkan. Could be an issue elsewhere, hence the individual commit.
1 parent d9f498e commit aa54da5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libavcodec/vulkan_h264.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,14 @@ static int vk_h264_end_frame(AVCodecContext *avctx)
483483
const H264Context *h = avctx->priv_data;
484484
H264Picture *pic = h->cur_pic_ptr;
485485
H264VulkanDecodePicture *hp = pic->hwaccel_picture_private;
486+
FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
486487
FFVulkanDecodePicture *vp = &hp->vp;
487488
FFVulkanDecodePicture *rvp[H264_MAX_PICTURE_COUNT] = { 0 };
488489
AVFrame *rav[H264_MAX_PICTURE_COUNT] = { 0 };
489490

491+
if (!dec->session_params)
492+
return AVERROR(EINVAL);
493+
490494
for (int i = 0; i < vp->decode_info.referenceSlotCount; i++) {
491495
H264Picture *rp = hp->ref_src[i];
492496
H264VulkanDecodePicture *rhp = rp->hwaccel_picture_private;

0 commit comments

Comments
 (0)