Fixes: out of array access
Fixes: tickets/10756/poc18ffmpeg
Discovered by Zeng Yunxiang
Signed-off-by: Michael Niedermayer <[email protected]>
---
libavfilter/avf_showwaves.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
index 329753c8c86..e19b93a2077 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)
--
2.17.1
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".