Fixes a bunch of valgrind errors when decoding random junk

This commit is contained in:
Jean-Marc Valin 2011-07-05 13:18:59 -04:00
parent ad15af8863
commit a0653ed1e7
5 changed files with 66 additions and 29 deletions

View file

@ -2411,7 +2411,9 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da
total_bits = len*8;
tell = ec_tell(dec);
if (tell==1)
if (tell >= total_bits)
silence = 1;
else if (tell==1)
silence = ec_dec_bit_logp(dec, 15);
else
silence = 0;