Commit 58244aa7 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry

Forward port r14811 and r16073 from libvorbis.

Additional bulletproofing to hufftree decoding; reject underpopulated trees
Handle the case of single-entry codebooks.

git-svn-id: 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 3d08906f
......@@ -121,7 +121,20 @@ ogg_uint32_t *_make_words(long *l,long n,long sparsecount){
/* sanity check the huffman tree; an underpopulated tree must be
rejected. The only exception is the one-node pseudo-nil tree,
which appears to be underpopulated because the tree doesn't
really exist; there's only one possible 'codeword' or zero bits,
but the above tree-gen code doesn't mark that. */
if(sparsecount != 1){
if(marker[i] & (0xffffffffUL>>(32-i))){
/* bitreverse the words because our bitwise packer/unpacker is LSb
endian */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment