Trac 2139 indirectly brought to light the case of a stream that uses a
authorMonty <xiphmont@xiph.org>
Thu, 26 Feb 2015 02:30:33 +0000 (02:30 +0000)
committerMonty <xiphmont@xiph.org>
Thu, 26 Feb 2015 02:30:33 +0000 (02:30 +0000)
commit65417f3a92d826b5005d239a332b81799f4e1868
treeaca7928f4b44881d9225bb87b41ae940aeaeb8ef
parent8a486869dad2d6cb2b6a5ca076b7b6fed9f5f8e0
Trac 2139 indirectly brought to light the case of a stream that uses a
single-entry codebook, but does not code a codeword of length 1 equal
to zero.  Such a stream could cause a stream to read garbage.

There is no apparent chance of garbage memory writes as this happen
entirely after decode setup, however there is playback DoS potential.

This commit special cases single-entry codebook setup so that decode
is well-defined for streams with single-entry codebooks, and adds some
comments to make it more clear how the case is handled.

svn path=/trunk/vorbis/; revision=19444
lib/codebook.c
lib/sharedbook.c