h264: only ref cur_pic in update_thread_context if it is initialized
It may be empty if the previous thread's decode call did not contain a valid frame. (cherry picked from commit0dea4c77cc
) Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit1dbfaa34e6
) Signed-off-by: Anton Khirnov <anton@khirnov.net> Conflicts: libavcodec/h264_slice.c
This commit is contained in:
@@ -1776,8 +1776,11 @@ static int decode_update_thread_context(AVCodecContext *dst,
|
||||
|
||||
h->cur_pic_ptr = REBASE_PICTURE(h1->cur_pic_ptr, h, h1);
|
||||
unref_picture(h, &h->cur_pic);
|
||||
if ((ret = ref_picture(h, &h->cur_pic, &h1->cur_pic)) < 0)
|
||||
if (h1->cur_pic.f.buf[0]) {
|
||||
ret = ref_picture(h, &h->cur_pic, &h1->cur_pic);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
h->workaround_bugs = h1->workaround_bugs;
|
||||
h->low_delay = h1->low_delay;
|
||||
|
Reference in New Issue
Block a user