Commit 35b1854da3 for ffmpeg
commit 35b1854da34ba2d27c3a131775cc8e90f3c605eb
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Thu Nov 12 01:19:37 2026 +0100
avfilter/vf_feedback: clamp the position after queued commands ran
Fixes: out of array read
Fixes: V4WgPHrcMhhG
Found during the triage of a finding from the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25800
Out of array read Replicated through UnModified FFmpeg with ASAN
diff --git a/libavfilter/vf_feedback.c b/libavfilter/vf_feedback.c
index 0665bde221..db0ebd12ee 100644
--- a/libavfilter/vf_feedback.c
+++ b/libavfilter/vf_feedback.c
@@ -120,8 +120,6 @@ static int activate(AVFilterContext *ctx)
int status, ret;
int64_t pts;
- adjust_pos(ctx, s);
-
for (int i = 0; i < ctx->nb_outputs; i++)
FF_FILTER_FORWARD_STATUS_BACK_ALL(ctx->outputs[i], ctx);
@@ -135,6 +133,7 @@ static int activate(AVFilterContext *ctx)
AVFrame *src = s->feed;
AVFrame *dst = NULL;
+ adjust_pos(ctx, s);
av_fifo_read(s->fifo, &dst, 1);
if (!dst)
return AVERROR_BUG;
@@ -198,6 +197,7 @@ static int activate(AVFilterContext *ctx)
if (ret > 0) {
AVFrame *frame;
+ adjust_pos(ctx, s);
ret = av_fifo_write(s->fifo, &in, 1);
if (ret < 0) {
av_frame_free(&in);