diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-02-12 12:26:58 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-02-21 09:40:43 +0100 |
commit | 03fbb6ff3d28f639ea5a35aba3c6dca09c17225d (patch) | |
tree | 09bfb28f2caa35d5b6db109ad17f7820ec67bc07 /libavcodec/h264.c | |
parent | a9602c6cfbe6fa06ff97ad01c0ffa9ad5ccff30f (diff) | |
download | ffmpeg-03fbb6ff3d28f639ea5a35aba3c6dca09c17225d.tar.gz |
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 commit 0dea4c77ccf5956561bb8991311b3d834bb5fa40)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 1dbfaa34e615606cb3f1a3ecabb117e354459edc)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Conflicts:
libavcodec/h264_slice.c
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 7e62881740..3c07477d39 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -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) - return ret; + 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; |