aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-09 15:25:20 +0200
committerReinhard Tartler <siretart@tauware.de>2013-04-18 22:05:20 +0200
commitd0c4d61c8bfdc074d6c20fb57760ac6b3200d9a9 (patch)
treecc49c63f3413bdb944b287bbf8c681ad1083303a
parent95db1624ef98ccc4ba7ff70d50c4b4d0f8ffed54 (diff)
downloadffmpeg-d0c4d61c8bfdc074d6c20fb57760ac6b3200d9a9.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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index cfae824d95..17729d18c9 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1838,6 +1838,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);