summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2014-08-03 20:39:59 +0200
committerNicolas George <george@nsup.org>2014-08-14 15:11:39 +0200
commit638eec2ac34b7f65a8e84203ea4292440bc8fe50 (patch)
tree2ad40e2edaeeadc556603c995ea7dcb87c956eb8 /libavfilter
parent7c10e32ae5a1e6e1ab654c5f84a0522500de773d (diff)
lavfi/avf_showspectrum: check RDFT context init.
Fix a segfault with large window size.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avf_showspectrum.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 9130f6f4ab..bd4d818d6b 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -177,6 +177,11 @@ static int config_output(AVFilterLink *outlink)
av_rdft_end(s->rdft);
s->rdft = av_rdft_init(rdft_bits, DFT_R2C);
+ if (!s->rdft) {
+ av_log(ctx, AV_LOG_ERROR, "Unable to create RDFT context. "
+ "The window size might be too high.\n");
+ return AVERROR(EINVAL);
+ }
s->rdft_bits = rdft_bits;
/* RDFT buffers: x2 for each (display) channel buffer.