Fixes: out of array access Fixes: tickets/10756/poc18ffmpeg Discovered by Zeng Yunxiang Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Unified · Split
| @@ -440,6 +440,8 @@ static int config_output(AVFilterLink *outlink) · 439 unmodified lines | ||
| 440 | 440 | |
| 441 | 441 | showwaves->history_nb_samples = av_rescale(showwaves->w * nb_channels * 2, |
| 442 | 442 | showwaves->n.num, showwaves->n.den); |
| 443 | + if (showwaves->history_nb_samples <= 0) | |
| 444 | + return AVERROR(EINVAL); | |
| 443 | 445 | showwaves->history = av_calloc(showwaves->history_nb_samples, |
| 444 | 446 | sizeof(*showwaves->history)); |
| 445 | 447 | if (!showwaves->history) |