diff --git a/libavcodec/h264.c b/libavcodec/h264.c index c55e11c40f..d125f54a03 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1972,6 +1972,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;