1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavfi/avf_showspectrum: check RDFT context init.

Fix a segfault with large window size.
This commit is contained in:
Nicolas George 2014-08-03 20:39:59 +02:00
parent 7c10e32ae5
commit 638eec2ac3

View File

@ -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.