From dcf0f82d08e88ea952aa97c16e4e774ce6c2ceb8 Mon Sep 17 00:00:00 2001 From: Dale Curtis Date: Thu, 2 Jan 2014 14:29:38 -0800 Subject: [PATCH] h264: Clear ERContext.cur_pic when unref'ing current picture. Signed-off-by: Dale Curtis (cherry picked from commit 4feca2214a0b69dcbe4d1c7cd145c3881459e867) Signed-off-by: Michael Niedermayer --- libavcodec/h264.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index f044a58a97..1b531f560b 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1957,6 +1957,10 @@ static int h264_frame_start(H264Context *h) h->cur_pic_ptr = pic; unref_picture(h, &h->cur_pic); + if (CONFIG_ERROR_RESILIENCE) { + h->er.cur_pic = NULL; + } + if ((ret = ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0) return ret;