Skip to content

Commit 158a337

Browse files
committed
Fix overflow: correct calculation of numAz_table
sizeof() of an array should be divided by sizeof() one element in the array to give the number of elements. Fixes leomccormack#49.
1 parent 6f3c6cc commit 158a337

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

framework/modules/saf_utilities/saf_utility_dvf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static const double p23[19] = { -0.67, 0.142, 3404., -0.91, -0.67, -1.21, -1.76,
4848
static const double p33[19] = { 0.174, -0.11, -1699., 0.437, 0.658, 2.02, 6.815, 0.614, 589.3, 16818., -9.39, -44.1, -23.6, -92.3, -1.81, 10.54, 0.532, 0.285, -2.08 };
4949
static const double q13[19] = { -1.75, -0.01, 7354., -2.18, -1.2, -1.59, -1.23, -0.89, 29.23, 1945., -0.06, 5.635, 3.308, 13.88, -0.88, -2.23, -0.96, -0.9, -0.57 };
5050
static const double q23[19] = { 0.699, -0.35, -5350., 1.188, 0.256, 0.816, 1.166, 0.76, 59.51, 1707., -1.12, -6.18, -3.39, -12.7, -0.19, 1.295, -0.02, -0.08, -0.4 };
51-
static const int numAz_table = sizeof(q23);
51+
static const int numAz_table = sizeof(q23) / sizeof(q23[0]);
5252

5353
/* a_0 = 0.0875f; Reference head size, 8.75 centimeters, used in the generation of the coeff lookup table. */
5454
/* a_head = 0.09096f; This head size, see note for head_radius in binauraliser_nf. */

0 commit comments

Comments
 (0)