[FFmpeg-cvslog] avcodec/g729postfilter: avoid potential negative shift

Michael Niedermayer git at videolan.org
Sun Apr 27 23:21:09 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Apr 27 23:12:42 2014 +0200| [1fc28cf1644e813f57dcdcf687e77dc3167b9823] | committer: Michael Niedermayer

avcodec/g729postfilter: avoid potential negative shift

Fixes CID1194402

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/g729postfilter.c b/libavcodec/g729postfilter.c
index fc90374..bcf509c 100644
--- a/libavcodec/g729postfilter.c
+++ b/libavcodec/g729postfilter.c
@@ -389,7 +389,7 @@ static int16_t long_term_filter(DSPContext *dsp, int pitch_delay_int,
         lt_filt_factor_a = (gain_den << 15) / (gain_den + gain_num);
     }
 #else
-    L64_temp0 = ((int64_t)gain_num) << (sh_gain_num - 1);
+    L64_temp0 = (((int64_t)gain_num) << sh_gain_num) >> 1;
     L64_temp1 = ((int64_t)gain_den) << sh_gain_den;
     lt_filt_factor_a = FFMAX((L64_temp1 << 15) / (L64_temp1 + L64_temp0), MIN_LT_FILT_FACTOR_A);
 #endif



More information about the ffmpeg-cvslog mailing list