Commit d5b455b7fa for ffmpeg
commit d5b455b7faca5debf36bc512d4f137b078fe553d
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat Nov 14 01:57:51 2026 +0100
avfilter/vf_entropy: allocate the histogram for all 16 bit sample values
Fixes: out of array access
Fixes: QHL0p233f9jc
Found during triage of the security report AISLE-2026-R0057
Out of array access Replicated through UnModified FFmpeg with ASAN
diff --git a/libavfilter/vf_entropy.c b/libavfilter/vf_entropy.c
index 1d13bb484b..4dbfcd4c3d 100644
--- a/libavfilter/vf_entropy.c
+++ b/libavfilter/vf_entropy.c
@@ -91,7 +91,7 @@ static int config_input(AVFilterLink *inlink)
s->planenames[2] = s->is_rgb ? 'B' : 'V';
s->planenames[3] = 'A';
- s->histogram = av_malloc_array(1 << s->depth, sizeof(*s->histogram));
+ s->histogram = av_calloc(1 << (s->depth > 8 ? 16 : 8), sizeof(*s->histogram));
if (!s->histogram)
return AVERROR(ENOMEM);