History

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>

Michael Niedermayer committed 2 years ago

Commit 08bd2cb1 parent 56c59301 file · +2 −0Browse files

Unified · Split

libavfilter/avf_showwaves.c+2−0
@@ -440,6 +440,8 @@ static int config_output(AVFilterLink *outlink) · 439 unmodified lines
440440
441441 showwaves->history_nb_samples = av_rescale(showwaves->w * nb_channels * 2,
442442 showwaves->n.num, showwaves->n.den);
443+ if (showwaves->history_nb_samples <= 0)
444+ return AVERROR(EINVAL);
443445 showwaves->history = av_calloc(showwaves->history_nb_samples,
444446 sizeof(*showwaves->history));
445447 if (!showwaves->history)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t