summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-04 23:54:38 +0200
committerwm4 <wm4@nowhere>2015-05-04 23:54:38 +0200
commiteead97f10303436b8da1c75dcdaa79efaba5b015 (patch)
tree1d369f74997ad24a5909d4bf045f61f5d4b688cd /audio/out
parentb6381a0ee383acb1ee7a9562b166c18066747b7f (diff)
downloadmpv-eead97f10303436b8da1c75dcdaa79efaba5b015.tar.bz2
mpv-eead97f10303436b8da1c75dcdaa79efaba5b015.tar.xz
ao_coreaudio: fix out of bounds access
ca_label_to_mp_speaker_id() checked whether the last entry was >= 0, but actually this condition was never true, and MP_SPEAKER_ID_UNKNOWN0 is not negative.
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao_coreaudio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c
index 5e923ac084..8716fcc75d 100644
--- a/audio/out/ao_coreaudio.c
+++ b/audio/out/ao_coreaudio.c
@@ -446,6 +446,8 @@ static const int speaker_map[][2] = {
{ kAudioChannelLabel_HeadphonesRight, MP_SPEAKER_ID_DR },
{ kAudioChannelLabel_Unknown, MP_SPEAKER_ID_UNKNOWN0 },
+
+ { 0, -1 },
};
static int ca_label_to_mp_speaker_id(AudioChannelLabel label)