mirror of https://github.com/mpv-player/mpv
coreaudio: reject descriptions with too many channels
This is a fix attempt for #1279 and #1249.
This commit is contained in:
parent
c070d16093
commit
9faf482d89
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue