From 13b4fb9d28ceeaf3ba505b13888268039bf5cc63 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 6 Dec 2014 11:16:12 +0000 Subject: 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 --- audio/filter/af_hrtf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'audio') diff --git a/audio/filter/af_hrtf.c b/audio/filter/af_hrtf.c index 4fb382aff4..5dc08f2dbf 100644 --- a/audio/filter/af_hrtf.c +++ b/audio/filter/af_hrtf.c @@ -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) -- cgit v1.2.3