[FFmpeg-cvslog] qdm2: check that the FFT size is a power of 2

Anton Khirnov git at videolan.org
Sun Oct 6 19:06:15 CEST 2013


ffmpeg | branch: release/0.7 | Anton Khirnov <anton at khirnov.net> | Tue Apr  9 15:25:20 2013 +0200| [96481c5e1843dda64df1df22f3bc12e6b10505fd] | committer: Reinhard Tartler

qdm2: check that the FFT size is a power of 2

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable at libav.org
(cherry picked from commit 34f87a58532ed652a6e0283c1d044ee5df0aef0b)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=96481c5e1843dda64df1df22f3bc12e6b10505fd
---

 libavcodec/qdm2.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 258a343..87ace65 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1878,6 +1878,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);



More information about the ffmpeg-cvslog mailing list