mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
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>
(cherry picked from commit 08bd2cbfeb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
41f32f0bc4
commit
ea276a511a
1 changed files with 2 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue