summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-12-07 17:57:41 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-12-09 15:00:29 +0000
commit4413e950b26396bfb797168e4f81164a022cc6f3 (patch)
treec71f1ef1361f3ab99ceb055fed93954703a1600d /libavcodec/h264_slice.c
parent06c62ce09c572a5875f6855a4cf1cd1a287d494b (diff)
downloadffmpeg-streaming-4413e950b26396bfb797168e4f81164a022cc6f3.zip
ffmpeg-streaming-4413e950b26396bfb797168e4f81164a022cc6f3.tar.gz
h264_slice: Wait for refs to be available before we use them in error concealment
This could happen when there was a frame number gap and frame threading was used. This fixes #5458. Debugging-by: Ronald S. Bultje <rsbultje@gmail.com> Debugging-by: Justin Ruggles <justin.ruggles@gmail.com> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 1f2c065..9a334a9 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1424,6 +1424,9 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
h->short_ref[0]->f->width == prev->f->width &&
h->short_ref[0]->f->height == prev->f->height &&
h->short_ref[0]->f->format == prev->f->format) {
+ ff_thread_await_progress(&prev->tf, INT_MAX, 0);
+ if (prev->field_picture)
+ ff_thread_await_progress(&prev->tf, INT_MAX, 1);
av_image_copy(h->short_ref[0]->f->data,
h->short_ref[0]->f->linesize,
(const uint8_t **)prev->f->data,
OpenPOWER on IntegriCloud