From 05c36e0e5fbf0b75dbbbd327ad2f6a62992f9262 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 10 Aug 2012 01:17:20 +0100 Subject: 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 --- libavcodec/g723_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/g723_1.c') 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; } -- cgit v1.2.3