diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 23f775414f..35473dff62 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1107,11 +1107,7 @@ static void flush_dpb(AVCodecContext *avctx) H264Context *h = avctx->priv_data; int i; - for (i = 0; i <= MAX_DELAYED_PIC_COUNT; i++) { - if (h->delayed_pic[i]) - h->delayed_pic[i]->reference = 0; - h->delayed_pic[i] = NULL; - } + memset(h->delayed_pic, 0, sizeof(h->delayed_pic)); ff_h264_flush_change(h);