aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-12-30 02:39:58 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-12-30 21:50:04 +0100
commit08bd2cbfeb34717d60ec62bcbaeb7996206df906 (patch)
tree3d023dd0f65c2d879501cf216feb0188157163f5
parent56c5930ec36be3bc63a27913d6f0a199912220c5 (diff)
downloadffmpeg-08bd2cbfeb34717d60ec62bcbaeb7996206df906.tar.gz
avfilter/avf_showwaves: Check history_nb_samples
Fixes: out of array access Fixes: tickets/10756/poc18ffmpeg Discovered by Zeng Yunxiang Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/avf_showwaves.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
index 329753c8c8..e19b93a207 100644
--- a/libavfilter/avf_showwaves.c
+++ b/libavfilter/avf_showwaves.c
@@ -440,6 +440,8 @@ static int config_output(AVFilterLink *outlink)
showwaves->history_nb_samples = av_rescale(showwaves->w * nb_channels * 2,
showwaves->n.num, showwaves->n.den);
+ if (showwaves->history_nb_samples <= 0)
+ return AVERROR(EINVAL);
showwaves->history = av_calloc(showwaves->history_nb_samples,
sizeof(*showwaves->history));
if (!showwaves->history)