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 c6c11b0b6d avfilter/af_loudnorm: fix limiter buffer over-allocation
c6c11b0b6d is described below
commit c6c11b0b6dcb31b4f8a25c29be8f117af04bcad8
Author: realies <[email protected]>
AuthorDate: Tue Jan 13 19:34:00 2026 +0200
Commit: michaelni <[email protected]>
CommitDate: Tue Jan 20 20:24:36 2026 +0000
avfilter/af_loudnorm: fix limiter buffer over-allocation
The limiter_buf was being allocated with buf_size (3000ms worth of
samples) instead of limiter_buf_size (210ms worth of samples).
This resulted in allocating approximately 14x more memory than needed
for the limiter buffer. At 192kHz stereo:
- buf_size: 1,152,000 samples = 9.2 MB
- limiter_buf_size: 80,640 samples = 0.6 MB
- Wasted: ~8.2 MB per filter instance
The bug was introduced when the limiter buffer was added but the
wrong size variable was used in av_malloc_array().
---
libavfilter/af_loudnorm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavfilter/af_loudnorm.c b/libavfilter/af_loudnorm.c
index 432b9710a5..00d0a145ae 100644
--- a/libavfilter/af_loudnorm.c
+++ b/libavfilter/af_loudnorm.c
@@ -774,7 +774,7 @@ static int config_input(AVFilterLink *inlink)
return AVERROR(ENOMEM);
s->limiter_buf_size = frame_size(inlink->sample_rate, 210) *
inlink->ch_layout.nb_channels;
- s->limiter_buf = av_malloc_array(s->buf_size, sizeof(*s->limiter_buf));
+ s->limiter_buf = av_malloc_array(s->limiter_buf_size,
sizeof(*s->limiter_buf));
if (!s->limiter_buf)
return AVERROR(ENOMEM);
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]