summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2008-04-07 02:11:14 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2008-04-07 02:11:14 +0000
commit231f0c208d63c76eb5c360725c651ff7d6b9f6bd (patch)
treea90605f08ed7058e6f473375bc30def0d9aca1a5 /apps/codecs
parent4a808073c7b99239db10df3dabe649fd1d7b55da (diff)
downloadrockbox-231f0c208d63c76eb5c360725c651ff7d6b9f6bd.zip
rockbox-231f0c208d63c76eb5c360725c651ff7d6b9f6bd.tar.gz
rockbox-231f0c208d63c76eb5c360725c651ff7d6b9f6bd.tar.bz2
rockbox-231f0c208d63c76eb5c360725c651ff7d6b9f6bd.tar.xz
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
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/libwma/bitstream.c2
-rw-r--r--apps/codecs/libwma/wmadeci.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/apps/codecs/libwma/bitstream.c b/apps/codecs/libwma/bitstream.c
index 4c4ab23..9e3d186 100644
--- a/apps/codecs/libwma/bitstream.c
+++ b/apps/codecs/libwma/bitstream.c
@@ -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;
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index e67a9dc..cba5180 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -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,