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;