[FFmpeg-devel] [PATCH 1/6] flacdec: change variable-length array to fixed length

Mans Rullgard mans
Wed Aug 19 03:22:57 CEST 2009


pred_order can never exceed 64, so always allocating that amount is safe
and not very wasteful.
---
 libavcodec/flacdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 4ff7fae..643ed24 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -358,7 +358,7 @@ static int decode_subframe_lpc(FLACContext *s, int channel, int pred_order)
 {
     int i, j;
     int coeff_prec, qlevel;
-    int coeffs[pred_order];
+    int coeffs[64];
     int32_t *decoded = s->decoded[channel];
 
     /* warm up samples */
-- 
1.6.4




More information about the ffmpeg-devel mailing list