Commit 638eec2a authored by Nicolas George's avatar Nicolas George

lavfi/avf_showspectrum: check RDFT context init.

Fix a segfault with large window size.
parent 7c10e32a
...@@ -177,6 +177,11 @@ static int config_output(AVFilterLink *outlink) ...@@ -177,6 +177,11 @@ static int config_output(AVFilterLink *outlink)
av_rdft_end(s->rdft); av_rdft_end(s->rdft);
s->rdft = av_rdft_init(rdft_bits, DFT_R2C); 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; s->rdft_bits = rdft_bits;
/* RDFT buffers: x2 for each (display) channel buffer. /* RDFT buffers: x2 for each (display) channel buffer.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment