shithub: opus

Download patch

ref: ce1173c77fa2ed5e731db2bbd4c7527d57a8c335
parent: cbb75ccb2635d21ab65ce4d85a9779cdeb1163e9
author: Jean-Marc Valin <[email protected]>
date: Mon Jan 20 13:45:57 EST 2014

Fixes use of uninitialized values in dynalloc_analysis()

--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -981,9 +981,9 @@
          tmp = median_of_3(&bandLogE2[c*nbEBands])-offset;
          f[0] = MAX16(f[0], tmp);
          f[1] = MAX16(f[1], tmp);
-         tmp = median_of_3(&bandLogE2[c*nbEBands+nbEBands-3])-offset;
-         f[nbEBands-2] = MAX16(f[nbEBands-2], tmp);
-         f[nbEBands-1] = MAX16(f[nbEBands-1], tmp);
+         tmp = median_of_3(&bandLogE2[c*nbEBands+end-3])-offset;
+         f[end-2] = MAX16(f[end-2], tmp);
+         f[end-1] = MAX16(f[end-1], tmp);
 
          for (i=0;i<end;i++)
             f[i] = MAX16(f[i], noise_floor[i]);