diff options
author | Xu Guangxin <guangxin.xu@intel.com> | 2021-01-06 11:12:34 +0800 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-09-09 12:53:25 -0300 |
commit | 3bbe0c210b05fc6fbd7b1d4bbd8479db7f2cf957 (patch) | |
tree | b793120d455bc78ab8d0443d19bd14ed49f34dff /libavcodec | |
parent | bb9141cc1397960bbc869ac9df3bab15e2dc6458 (diff) | |
download | ffmpeg-3bbe0c210b05fc6fbd7b1d4bbd8479db7f2cf957.tar.gz |
avcodec/qsv_enc: do not reuse enc_ctrl from previous frames
fixes #8857
If we do not clear the enc_ctrl, we will reuse previous frames' data like FrameType.
Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/qsvenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 50ec7065ca..090fdbe75e 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -1271,6 +1271,8 @@ static void clear_unused_frames(QSVEncContext *q) while (cur) { if (cur->used && !cur->surface.Data.Locked) { free_encoder_ctrl_payloads(&cur->enc_ctrl); + //do not reuse enc_ctrl from previous frame + memset(&cur->enc_ctrl, 0, sizeof(cur->enc_ctrl)); if (cur->frame->format == AV_PIX_FMT_QSV) { av_frame_unref(cur->frame); } |