diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-09 15:25:20 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-04-24 21:01:14 +0200 |
commit | 43c0a87279e717c1384314c6da7155c306ee7c60 (patch) | |
tree | 6da236737bc970b5b5a1e49b6b3a87afb4f9d1d8 | |
parent | c579d4283edb87933632d9cf818b4244d1474d23 (diff) | |
download | ffmpeg-43c0a87279e717c1384314c6da7155c306ee7c60.tar.gz |
qdm2: check that the FFT size is a power of 2
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 34f87a58532ed652a6e0283c1d044ee5df0aef0b)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/qdm2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 739971eb83..59bce40c2d 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1881,6 +1881,10 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "Unknown FFT order (%d), contact the developers!\n", s->fft_order); return -1; } + if (s->fft_size != (1 << (s->fft_order - 1))) { + av_log(avctx, AV_LOG_ERROR, "FFT size %d not power of 2.\n", s->fft_size); + return AVERROR_INVALIDDATA; + } ff_rdft_init(&s->rdft_ctx, s->fft_order, IDFT_C2R); ff_mpadsp_init(&s->mpadsp); |