ffmpeg | branch: master | Xu Guangxin <[email protected]> | Wed Jan  6 
11:12:34 2021 +0800| [3bbe0c210b05fc6fbd7b1d4bbd8479db7f2cf957] | committer: 
James Almer

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 <[email protected]>
Signed-off-by: James Almer <[email protected]>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3bbe0c210b05fc6fbd7b1d4bbd8479db7f2cf957
---

 libavcodec/qsvenc.c | 2 ++
 1 file changed, 2 insertions(+)

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);
             }

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to