summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/lib/ffmpeg_bitstream.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/codecs/lib/ffmpeg_bitstream.c b/apps/codecs/lib/ffmpeg_bitstream.c
index c879661c47..be0a3a11f6 100644
--- a/apps/codecs/lib/ffmpeg_bitstream.c
+++ b/apps/codecs/lib/ffmpeg_bitstream.c
@@ -288,14 +288,21 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
288 codecs use it, there's a LUT based bit reverse function for this commented 288 codecs use it, there's a LUT based bit reverse function for this commented
289 out above (bitswap_32) and an inline asm version in libtremor/codebook.c 289 out above (bitswap_32) and an inline asm version in libtremor/codebook.c
290 if we ever want this */ 290 if we ever want this */
291
292static VLCcode buf[1500]; /* worst case is wma, which has one table with 1336 entries */
293
291int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, 294int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
292 const void *bits, int bits_wrap, int bits_size, 295 const void *bits, int bits_wrap, int bits_size,
293 const void *codes, int codes_wrap, int codes_size, 296 const void *codes, int codes_wrap, int codes_size,
294 const void *symbols, int symbols_wrap, int symbols_size, 297 const void *symbols, int symbols_wrap, int symbols_size,
295 int flags) 298 int flags)
296{ 299{
297 VLCcode buf[nb_codes+1]; /* worst case from cook seems to be nb_codes == 607 300 if (nb_codes+1 > (int)(sizeof (buf)/ sizeof (VLCcode)))
298 which would make this about 4.8k... */ 301 {
302 DEBUGF("Table is larger than temp buffer!\n");
303 return -1;
304 }
305
299 int i, j, ret; 306 int i, j, ret;
300 307
301 vlc->bits = nb_bits; 308 vlc->bits = nb_bits;