diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-02 18:15:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-05 04:45:56 +0200 |
commit | c13e38bac7e78cbf016749e3d320cd622f6f1f45 (patch) | |
tree | 342830e5f90ff068e0aec4b17ada70f11296e7e0 | |
parent | 01c4fe7ee7b3a12cb536768edf45baf7a25d6fd2 (diff) | |
download | ffmpeg-c13e38bac7e78cbf016749e3d320cd622f6f1f45.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>
(cherry picked from commit e706fe764049b3f1ccf10ba9f686426a4c007906)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-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 d7a1c61e91..bf9f918cd9 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; |