From 292540b4728a43a498d230c5559f6fba825e1831 Mon Sep 17 00:00:00 2001 From: "Joshua C. Colp" Date: Tue, 29 Mar 2022 12:22:17 -0300 Subject: [PATCH] build: Fix warning under modern GCC. The mpglib library had some fun code to clear out the remainder of an array. This tripped up the array bounds check. This change makes the code just go through the array until it reaches the end, instead. ASTERISK-29687 ASTERISK-29712 Change-Id: Ib4f636409fe58d31ead3bd3f958cd74c087b892d --- layer3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/layer3.c b/layer3.c index e635576..30e1eb5 100644 --- a/layer3.c +++ b/layer3.c @@ -948,8 +948,7 @@ static int III_dequantize_sample(struct mpstr *mp, real xr[SBLIMIT][SSLIMIT],int /* * zero part */ - for(i=(&xr[SBLIMIT][0]-xrpnt)>>1;i;i--) { - *xrpnt++ = 0.0; + while (xrpnt <= &xr[SBLIMIT-1][SSLIMIT-1]) { *xrpnt++ = 0.0; }