diff options
author | Måns Rullgård <mans@mansr.com> | 2010-06-24 09:42:34 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-06-24 09:42:34 +0000 |
commit | dd93649b7160eb0a15cebddb2a46e1ba82437387 (patch) | |
tree | e5d3e0e8714cfc8a6fada16b10860e1a8d403269 /libavcodec/mdct.c | |
parent | 796cea09b651e74a0efd162983036524a66d7791 (diff) | |
download | ffmpeg-dd93649b7160eb0a15cebddb2a46e1ba82437387.tar.gz |
Remove VLA in ff_kbd_window_init, limit window size to 1024
Originally committed as revision 23755 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mdct.c')
-rw-r--r-- | libavcodec/mdct.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mdct.c b/libavcodec/mdct.c index 69e1bbff22..c511188d22 100644 --- a/libavcodec/mdct.c +++ b/libavcodec/mdct.c @@ -36,9 +36,11 @@ av_cold void ff_kbd_window_init(float *window, float alpha, int n) { int i, j; double sum = 0.0, bessel, tmp; - double local_window[n]; + double local_window[FF_KBD_WINDOW_MAX]; double alpha2 = (alpha * M_PI / n) * (alpha * M_PI / n); + assert(n <= FF_KBD_WINDOW_MAX); + for (i = 0; i < n; i++) { tmp = i * (n - i) * alpha2; bessel = 1.0; |