diff options
author | Mans Rullgard <mans@mansr.com> | 2012-08-10 01:17:20 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-08-10 12:18:38 +0100 |
commit | 05c36e0e5fbf0b75dbbbd327ad2f6a62992f9262 (patch) | |
tree | 5799d43568ed2422cced6c16f973c3464f9e6b3b /libavcodec | |
parent | 52aa3015a3c895cf74e555c4bb56c08cd067383e (diff) | |
download | ffmpeg-05c36e0e5fbf0b75dbbbd327ad2f6a62992f9262.tar.gz |
g723.1: fix addition overflow
This addition must be done as 64-bit to avoid overflow and for
the subsequent clipping to be meaningful.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/g723_1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c index 53b9adedd4..7d8a48e18a 100644 --- a/libavcodec/g723_1.c +++ b/libavcodec/g723_1.c @@ -979,7 +979,7 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf) /* Compensation filter */ for (j = 0; j < SUBFRAME_LEN; j++) { - buf_ptr[j] = av_clipl_int32(signal_ptr[j] + + buf_ptr[j] = av_clipl_int32((int64_t)signal_ptr[j] + ((signal_ptr[j - 1] >> 16) * temp << 1)) >> 16; } |