From d02fcccd4ba9966735a2738ea9eac233f1741f3e Mon Sep 17 00:00:00 2001 From: Ramesh Katuri Date: Tue, 26 Feb 2019 10:59:08 +0530 Subject: [PATCH] Fix for addition overflow in voronoi_idx_dec Added saturation check in ixheaacd_avq_dec.c file. Bug:126154841 Test: poc Change-Id: I8fe1e1b194bdde2854bb3b41c2b8b9bf00afc125 --- decoder/ixheaacd_avq_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decoder/ixheaacd_avq_dec.c b/decoder/ixheaacd_avq_dec.c index 3d8aed0..15c228c 100644 --- a/decoder/ixheaacd_avq_dec.c +++ b/decoder/ixheaacd_avq_dec.c @@ -157,7 +157,7 @@ VOID ixheaacd_voronoi_idx_dec(WORD32 *kv, WORD32 m, WORD32 *y, WORD32 count) { for (i = 6; i >= 1; i--) { tmp = ixheaacd_shl32_sat(kv[i], 1); sum = ixheaacd_add32_sat(sum, tmp); - y[i] += tmp; + y[i] = ixheaacd_add32_sat(y[i], tmp); z[i] = y[i] >> count; rem1[i] = y[i] & (m - 1); }