diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-02 18:15:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-02 18:15:12 +0200 |
commit | e706fe764049b3f1ccf10ba9f686426a4c007906 (patch) | |
tree | d0bb0a08ad07e021ee55b1e784a936e4351f1ac2 /libavcodec/wavpackenc.c | |
parent | 2b501b553f6300bfec546fe81d2bc0473e43e223 (diff) | |
download | ffmpeg-e706fe764049b3f1ccf10ba9f686426a4c007906.tar.gz |
avcodec/wavpackenc: Fix log2sample() result value
Found-by: CSA
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wavpackenc.c')
-rw-r--r-- | libavcodec/wavpackenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 66ebf2fa3c..5b8973c5c7 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -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; |