forked from len0rd/rockbox
libwma has Huffman tables that are too big for the stack temp buffer. Make temp buffer static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27446 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5b5275a6c9
commit
bb22ac539b
1 changed files with 9 additions and 2 deletions
|
@ -288,14 +288,21 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
|
||||||
codecs use it, there's a LUT based bit reverse function for this commented
|
codecs use it, there's a LUT based bit reverse function for this commented
|
||||||
out above (bitswap_32) and an inline asm version in libtremor/codebook.c
|
out above (bitswap_32) and an inline asm version in libtremor/codebook.c
|
||||||
if we ever want this */
|
if we ever want this */
|
||||||
|
|
||||||
|
static VLCcode buf[1500]; /* worst case is wma, which has one table with 1336 entries */
|
||||||
|
|
||||||
int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
|
int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
|
||||||
const void *bits, int bits_wrap, int bits_size,
|
const void *bits, int bits_wrap, int bits_size,
|
||||||
const void *codes, int codes_wrap, int codes_size,
|
const void *codes, int codes_wrap, int codes_size,
|
||||||
const void *symbols, int symbols_wrap, int symbols_size,
|
const void *symbols, int symbols_wrap, int symbols_size,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
VLCcode buf[nb_codes+1]; /* worst case from cook seems to be nb_codes == 607
|
if (nb_codes+1 > (int)(sizeof (buf)/ sizeof (VLCcode)))
|
||||||
which would make this about 4.8k... */
|
{
|
||||||
|
DEBUGF("Table is larger than temp buffer!\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int i, j, ret;
|
int i, j, ret;
|
||||||
|
|
||||||
vlc->bits = nb_bits;
|
vlc->bits = nb_bits;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue