This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new cd4fc473be avfilter/af_afir: clamp initial ir selection
cd4fc473be is described below

commit cd4fc473be3ca20704615d8ea110effe7fe11e13
Author:     Ayoub Nabil Boubagrat 
<[email protected]>
AuthorDate: Wed Aug 19 15:36:37 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Fri Aug 21 18:11:48 2026 +0000

    avfilter/af_afir: clamp initial ir selection
    
    the ir option may exceed nbirs because its static range is independent
    of the configured number of impulse responses. init() only clamps
    prev_selir, leaving selir able to index ctx->inputs out of range.
    
    with the default nbirs=1, afir=ir=1 reads ctx->inputs[2] and crashes.
    clamp selir like process_command() and add a fate test.
    
    Signed-off-by: Ayoub Nabil Boubagrat 
<[email protected]>
---
 libavfilter/af_afir.c       | 4 +++-
 tests/fate/filter-audio.mak | 6 ++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index 38dabc08c1..ae021b7a6f 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -663,7 +663,9 @@ static av_cold int init(AVFilterContext *ctx)
     AVFilterPad pad;
     int ret;
 
-    s->prev_selir = FFMIN(s->nb_irs - 1, s->selir);
+    /* ir is bounded by nbirs, not by its static AVOption range. */
+    s->selir      = FFMIN(s->nb_irs - 1, s->selir);
+    s->prev_selir = s->selir;
 
     pad = (AVFilterPad) {
         .name = "main",
diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 6593750805..b5c27daf1c 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -92,6 +92,12 @@ fate-filter-anequalizer: tests/data/filtergraphs/anequalizer
 fate-filter-anequalizer: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
 fate-filter-anequalizer: CMD = framecrc -auto_conversion_filters -i $(SRC) 
-/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/anequalizer
 
+FATE_AFILTER-$(call FILTERDEMDECENCMUX, AFIR ARESAMPLE ATRIM, WAV, PCM_S16LE, 
PCM_S16LE, WAV) += fate-filter-afir-selir
+fate-filter-afir-selir: tests/data/asynth-44100-2.wav
+fate-filter-afir-selir: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
+fate-filter-afir-selir: CMD = framecrc -auto_conversion_filters -i $(SRC) -i 
$(SRC) -filter_complex "[1:a]atrim=end=0.05[ir];[0:a][ir]afir=ir=1[aout]" -map 
"[aout]" -frames:a 1
+fate-filter-afir-selir: CMP = null
+
 FATE_AFILTER-$(call FILTERDEMDECENCMUX, ASETNSAMPLES, WAV, PCM_S16LE, 
PCM_S16LE, WAV) += fate-filter-asetnsamples-pad
 fate-filter-asetnsamples-pad: tests/data/asynth-44100-2.wav
 fate-filter-asetnsamples-pad: SRC = 
$(TARGET_PATH)/tests/data/asynth-44100-2.wav

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to