af_hrtf: Fix out-of-range read.

Based on patch by Yuriy Kaminskiy [yumkam gmail].

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@37330 b3059339-0415-0410-9bf9-f77b7e298cf2
Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
reimar 2014-12-06 11:16:12 +00:00 committed by wm4
parent 685b8b7a00
commit 13b4fb9d28
1 changed files with 7 additions and 2 deletions

View File

@ -280,8 +280,13 @@ static inline void update_ch(af_hrtf_t *s, short *in, const int k)
}
/* We need to update the bass compensation delay line, too. */
s->ba_l[k] = in[0] + in[4] + in[2];
s->ba_r[k] = in[4] + in[1] + in[3];
// TODO: should this use lf/cf/rf etc. instead?
s->ba_l[k] = in[0];
s->ba_r[k] = in[1];
if (s->decode_mode == HRTF_MIX_51) {
s->ba_l[k] += in[4] + in[2];
s->ba_r[k] += in[4] + in[3];
}
}
static void clear_coeff(af_hrtf_t *s, float *c)