summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-12-06 16:34:21 +0000
committerNils Wallménius <nils@rockbox.org>2010-12-06 16:34:21 +0000
commit4487107d25b6bd5f9d197439159a6c95d696fff7 (patch)
tree866c7c3b7a97567afda3ffd15578ea3e56b7b23b /apps/codecs/libtremor
parent67efbc13870ee87ce3df442f7c396c13481921ec (diff)
downloadrockbox-4487107d25b6bd5f9d197439159a6c95d696fff7.tar.gz
rockbox-4487107d25b6bd5f9d197439159a6c95d696fff7.zip
libtremor: merge upstream revision 17510.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28744 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libtremor')
-rw-r--r--apps/codecs/libtremor/sharedbook.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/codecs/libtremor/sharedbook.c b/apps/codecs/libtremor/sharedbook.c
index 9519976c95..884920ecda 100644
--- a/apps/codecs/libtremor/sharedbook.c
+++ b/apps/codecs/libtremor/sharedbook.c
@@ -122,7 +122,20 @@ static ogg_uint32_t *_make_words(long *l,long n,long sparsecount){
122 }else 122 }else
123 if(sparsecount==0)count++; 123 if(sparsecount==0)count++;
124 } 124 }
125 125
126 /* sanity check the huffman tree; an underpopulated tree must be
127 rejected. The only exception is the one-node pseudo-nil tree,
128 which appears to be underpopulated because the tree doesn't
129 really exist; there's only one possible 'codeword' or zero bits,
130 but the above tree-gen code doesn't mark that. */
131 if(sparsecount != 1){
132 for(i=1;i<33;i++)
133 if(marker[i] & (0xffffffffUL>>(32-i))){
134 _ogg_free(r);
135 return(NULL);
136 }
137 }
138
126 /* bitreverse the words because our bitwise packer/unpacker is LSb 139 /* bitreverse the words because our bitwise packer/unpacker is LSb
127 endian */ 140 endian */
128 for(i=0,count=0;i<n;i++){ 141 for(i=0,count=0;i<n;i++){