Commit e706fe76 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wavpackenc: Fix log2sample() result value

Found-by: CSA
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2b501b55
......@@ -638,7 +638,7 @@ static uint32_t log2sample(uint32_t v, int limit, uint32_t *result)
if ((v += v >> 9) < (1 << 8)) {
dbits = nbits_table[v];
result += (dbits << 8) + wp_log2_table[(v << (9 - dbits)) & 0xff];
*result += (dbits << 8) + wp_log2_table[(v << (9 - dbits)) & 0xff];
} else {
if (v < (1L << 16))
dbits = nbits_table[v >> 8] + 8;
......@@ -647,7 +647,7 @@ static uint32_t log2sample(uint32_t v, int limit, uint32_t *result)
else
dbits = nbits_table[v >> 24] + 24;
result += dbits = (dbits << 8) + wp_log2_table[(v >> (dbits - 9)) & 0xff];
*result += dbits = (dbits << 8) + wp_log2_table[(v >> (dbits - 9)) & 0xff];
if (limit && dbits >= limit)
return 1;
......
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