forked from len0rd/rockbox
Let the console know when the huffman tables have overflown. This should never happen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17012 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4a808073c7
commit
231f0c208d
2 changed files with 4 additions and 0 deletions
|
|
@ -106,6 +106,8 @@ static int alloc_table(VLC *vlc, int size)
|
|||
index = vlc->table_size;
|
||||
vlc->table_size += size;
|
||||
if (vlc->table_size > vlc->table_allocated) {
|
||||
DEBUGF("Tried to allocate past the end of a Huffman table: %d/%d\n",
|
||||
vlc->table_allocated, vlc->table_allocated+(1 << vlc->bits));
|
||||
vlc->table_allocated += (1 << vlc->bits);
|
||||
if (!vlc->table)
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -663,6 +663,7 @@ int wma_decode_init(WMADecodeContext* s, asf_waveformatex_t *wfx)
|
|||
#endif
|
||||
|
||||
s->hgain_vlc.table = vlcbuf4;
|
||||
s->hgain_vlc.table_allocated = VLCBUF4SIZE;
|
||||
init_vlc(&s->hgain_vlc, HGAINVLCBITS, sizeof(hgain_huffbits),
|
||||
hgain_huffbits, 1, 1,
|
||||
hgain_huffcodes, 2, 2, 0);
|
||||
|
|
@ -672,6 +673,7 @@ int wma_decode_init(WMADecodeContext* s, asf_waveformatex_t *wfx)
|
|||
{
|
||||
|
||||
s->exp_vlc.table = vlcbuf3;
|
||||
s->exp_vlc.table_allocated = VLCBUF3SIZE;
|
||||
|
||||
init_vlc(&s->exp_vlc, EXPVLCBITS, sizeof(scale_huffbits),
|
||||
scale_huffbits, 1, 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue