diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-12-04 21:50:40 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-12-04 21:51:06 +0100 |
commit | 9faf482d89343ee16625ad698b92deebec65f0dc (patch) | |
tree | fe5ebbcf93278c637bea502f274cd0371dd17614 /audio/out/ao_coreaudio.c | |
parent | c070d160936820f993914ef4c4b83cecc5a4030e (diff) | |
download | mpv-9faf482d89343ee16625ad698b92deebec65f0dc.tar.bz2 mpv-9faf482d89343ee16625ad698b92deebec65f0dc.tar.xz |
coreaudio: reject descriptions with too many channels
This is a fix attempt for #1279 and #1249.
Diffstat (limited to 'audio/out/ao_coreaudio.c')
-rw-r--r-- | audio/out/ao_coreaudio.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 642a1bf683..013b47e17d 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -410,6 +410,13 @@ bool ca_layout_to_mp_chmap(struct ao *ao, AudioChannelLayout *layout, // to the waveextensible definition: this is the kind of // descriptions we process here. + if (layout->mNumberChannelDescriptions > MP_NUM_CHANNELS) { + MP_VERBOSE(ao, "layout has too many descriptions (%u, max: %d)", + (unsigned) layout->mNumberChannelDescriptions, + MP_NUM_CHANNELS); + goto coreaudio_error; + } + for (int n = 0; n < layout->mNumberChannelDescriptions; n++) { AudioChannelLabel label = layout->mChannelDescriptions[n].mChannelLabel; uint8_t speaker = ca_label_to_mp_speaker_id(label); |