Skip to content
Snippets Groups Projects
Commit 16abc6fe authored by Timothy B. Terriberry's avatar Timothy B. Terriberry Committed by Gregory Maxwell
Browse files

Fix for ec_enc_patch_initial_bits().

The test to make sure that _nbits had been encoded was checking for
 8-_nbits instead of _nbits.
This only affected cases when less than 8 bits had ever been
 encoded by the time the initial bits were patched.
parent c8649d0e
No related branches found
No related tags found
No related merge requests found
......@@ -225,7 +225,7 @@ void ec_enc_patch_initial_bits(ec_enc *_this,unsigned _val,unsigned _nbits){
/*The first byte is still awaiting carry propagation.*/
_this->rem=(_this->rem&~mask)|_val<<shift;
}
else if(_this->rng<=(EC_CODE_TOP>>shift)){
else if(_this->rng<=(EC_CODE_TOP>>_nbits)){
/*The renormalization loop has never been run.*/
_this->val=(_this->val&~((opus_uint32)mask<<EC_CODE_SHIFT))|
(opus_uint32)_val<<(EC_CODE_SHIFT+shift);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment