diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2014-12-06 11:16:12 +0000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-06 17:09:57 +0100 |
commit | 13b4fb9d28ceeaf3ba505b13888268039bf5cc63 (patch) | |
tree | 04dfbb2187e3e66b47408d930d05d280f23fdeb0 /audio | |
parent | 685b8b7a00ad171f76aba6a93ffaff890aa0caa1 (diff) | |
download | mpv-13b4fb9d28ceeaf3ba505b13888268039bf5cc63.tar.bz2 mpv-13b4fb9d28ceeaf3ba505b13888268039bf5cc63.tar.xz |
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>
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_hrtf.c | 9 |
1 files changed, 7 insertions, 2 deletions
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) |