[FFmpeg-cvslog] g723_1: fix off-by-one error in normalize_bits()

Kostya Shishkov git at videolan.org
Fri Aug 3 23:30:30 CEST 2012


ffmpeg | branch: master | Kostya Shishkov <kostya.shishkov at gmail.com> | Thu Aug  2 07:48:08 2012 +0200| [8772d2511a4ac45f275eaef2b4b6b1ef132c993b] | committer: Kostya Shishkov

g723_1: fix off-by-one error in normalize_bits()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8772d2511a4ac45f275eaef2b4b6b1ef132c993b
---

 libavcodec/g723_1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index 11e90e8..91f1b86 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -274,7 +274,7 @@ static int normalize_bits(int num, int width)
     if (num < 0)
         num = ~num;
 
-    return width - av_log2(num);
+    return width - av_log2(num) - 1;
 }
 
 /**



More information about the ffmpeg-cvslog mailing list