diff --git a/libavfilter/framequeue.c b/libavfilter/framequeue.c index 383c195b85..ace0dad689 100644 --- a/libavfilter/framequeue.c +++ b/libavfilter/framequeue.c @@ -79,9 +79,8 @@ int ff_framequeue_add(FFFrameQueue *fq, AVFrame *frame) FFFrameBucket *nq = av_realloc_array(fq->queue, na, sizeof(*nq)); if (!nq) return AVERROR(ENOMEM); - if (fq->tail + fq->queued > fq->allocated) - memmove(nq + fq->allocated, nq, - (fq->tail + fq->queued - fq->allocated) * sizeof(*nq)); + if (fq->tail) + memmove(nq + fq->allocated, nq, fq->tail * sizeof(*nq)); fq->queue = nq; fq->allocated = na; }