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:29:27 +0100 |
commit | 0dea4c77ccf5956561bb8991311b3d834bb5fa40 (patch) | |
tree | aac3fccab359fadea34e10e602f20e9f0d93035c | |
parent | 9abc80f1ed673141326341e26a05c3e1f78576d0 (diff) | |
download | ffmpeg-0dea4c77ccf5956561bb8991311b3d834bb5fa40.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.
-rw-r--r-- | libavcodec/h264_slice.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index e1e87ebe68..48882190a2 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -553,8 +553,11 @@ int ff_h264_update_thread_context(AVCodecContext *dst, h->cur_pic_ptr = REBASE_PICTURE(h1->cur_pic_ptr, h, h1); ff_h264_unref_picture(h, &h->cur_pic); - if ((ret = ff_h264_ref_picture(h, &h->cur_pic, &h1->cur_pic)) < 0) - return ret; + if (h1->cur_pic.f.buf[0]) { + ret = ff_h264_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; |