Commit d9c9bebe78 for ffmpeg
commit d9c9bebe78fb6375e66e1e8d4df460114d28390e
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Mon Oct 12 02:16:17 2026 +0200
avfilter/af_sofalizer: check the IR length against the IR data
Fixes: out of array read
Fixes: 65nc8s5OIq4Z
Regression since: 4096c670ab
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24624
Out of array read Replicated through UnModified FFmpeg with ASAN
diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index e1670d08e7..91bc4d0305 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -153,7 +153,7 @@ static int preload_sofa(AVFilterContext *ctx, char *filename, int *samplingrate)
return ret;
}
- if (!mysofa->N) {
+ if (!mysofa->N || !mysofa->M || mysofa->DataIR.elements / mysofa->M / mysofa->R < mysofa->N) {
av_log(ctx, AV_LOG_ERROR, "Selected SOFA file has inconsistent dimensions.\n");
return AVERROR_INVALIDDATA;
}