summaryrefslogtreecommitdiff
path: root/libavcodec/qdm2.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-09 15:25:20 +0200
committerAnton Khirnov <anton@khirnov.net>2013-04-17 10:56:11 +0200
commit34f87a58532ed652a6e0283c1d044ee5df0aef0b (patch)
treee884ac0593cc3c6889c723a8bcc201ec2a3e3b8e /libavcodec/qdm2.c
parentecff5acb5a738fcb4f9e206a12070dac4bf259b3 (diff)
qdm2: check that the FFT size is a power of 2
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/qdm2.c')
-rw-r--r--libavcodec/qdm2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 91ef524ad6..1e0811c861 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1835,6 +1835,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);