[FFmpeg-cvslog] avcodec/wavpackenc: Fix log2sample() result value
Michael Niedermayer
git at videolan.org
Tue Aug 5 04:58:09 CEST 2014
ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Sat Aug 2 18:15:12 2014 +0200| [c13e38bac7e78cbf016749e3d320cd622f6f1f45] | committer: Michael Niedermayer
avcodec/wavpackenc: Fix log2sample() result value
Found-by: CSA
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit e706fe764049b3f1ccf10ba9f686426a4c007906)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c13e38bac7e78cbf016749e3d320cd622f6f1f45
---
libavcodec/wavpackenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index d7a1c61..bf9f918 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;
More information about the ffmpeg-cvslog
mailing list