From 7519718216a2b98eb289ba20ba27685dff1cf686 Mon Sep 17 00:00:00 2001 From: Jun Zhao <jun.z...@intel.com> Date: Wed, 6 Dec 2017 15:50:05 +0800 Subject: [PATCH] lavc/vaap_encode_h265: Init the refs with predefined value.
Give a explicit init value to ref0/ref1 list to avoid use default value assgined by compiler, in iHD driver, it's will lead to HEVC ENC crash. h264_vaapi encoder use this way too. Signed-off-by: Jun Zhao <jun.z...@intel.com> --- libavcodec/vaapi_encode_h265.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index 2fc94be632..db9a7163cc 100644 --- a/libavcodec/vaapi_encode_h265.c +++ b/libavcodec/vaapi_encode_h265.c @@ -757,6 +757,12 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, else sh->slice_qp_delta = priv->fixed_qp_idr - (pps->init_qp_minus26 + 26); + for (i = 0; i < FF_ARRAY_ELEMS(vslice->ref_pic_list0); i++) { + vslice->ref_pic_list0[i].picture_id = VA_INVALID_ID; + vslice->ref_pic_list0[i].flags = VA_PICTURE_HEVC_INVALID; + vslice->ref_pic_list1[i].picture_id = VA_INVALID_ID; + vslice->ref_pic_list1[i].flags = VA_PICTURE_HEVC_INVALID; + } *vslice = (VAEncSliceParameterBufferHEVC) { .slice_segment_address = sh->slice_segment_address, -- 2.14.1
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel