mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 15:19:38 +03:00
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 <237098474+ayoubnabil@users.noreply.github.com>
This commit is contained in:
committed by
michaelni
parent
1a6a186b80
commit
cd4fc473be
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user