Mercurial > libavcodec.hg
comparison flacdec.c @ 10066:3fca809be8ed libavcodec
flacdec: change variable-length array to fixed length
pred_order can never exceed 32, so always allocating that amount is safe
and not very wasteful.
author | mru |
---|---|
date | Wed, 19 Aug 2009 21:59:36 +0000 |
parents | 7ad7d4094d1f |
children | f2d62b685d49 |
comparison
equal
deleted
inserted
replaced
10065:42a126c78744 | 10066:3fca809be8ed |
---|---|
356 | 356 |
357 static int decode_subframe_lpc(FLACContext *s, int channel, int pred_order) | 357 static int decode_subframe_lpc(FLACContext *s, int channel, int pred_order) |
358 { | 358 { |
359 int i, j; | 359 int i, j; |
360 int coeff_prec, qlevel; | 360 int coeff_prec, qlevel; |
361 int coeffs[pred_order]; | 361 int coeffs[32]; |
362 int32_t *decoded = s->decoded[channel]; | 362 int32_t *decoded = s->decoded[channel]; |
363 | 363 |
364 /* warm up samples */ | 364 /* warm up samples */ |
365 for (i = 0; i < pred_order; i++) { | 365 for (i = 0; i < pred_order; i++) { |
366 decoded[i] = get_sbits_long(&s->gb, s->curr_bps); | 366 decoded[i] = get_sbits_long(&s->gb, s->curr_bps); |