Commit 2e70a189b9 for ffmpeg
commit 2e70a189b9025158d9db04abf6acd6692e87c797
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Fri Nov 6 03:52:54 2026 +0100
avfilter/af_anlmdn: do not write past the end of a short last frame
Fixes: heap-buffer-overflow
Fixes: uQUc1sfqWcj8
Found-by: Secbuddy, Tencent Keen Security Lab (tested by kvartet)
Heap out of array write Replicated through UnModified FFmpeg with ASAN
diff --git a/libavfilter/af_anlmdn.c b/libavfilter/af_anlmdn.c
index ce91eb1cfd..366e63cb09 100644
--- a/libavfilter/af_anlmdn.c
+++ b/libavfilter/af_anlmdn.c
@@ -219,7 +219,7 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
memcpy(&src[offset], in->extended_data[ch], in->nb_samples * sizeof(float));
memset(&src[offset + in->nb_samples], 0, (H - in->nb_samples) * sizeof(float));
- for (int i = S; i < H + S; i++) {
+ for (int i = S; i < in->nb_samples + S; i++) {
float P = 0.f, Q = 0.f;
int v = 0;