summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorArun Raghavan <git@arunraghavan.net>2016-01-04 12:33:11 +0530
committerArun Raghavan <git@arunraghavan.net>2016-02-12 19:34:58 +0530
commit3977a906e21fe215051c0a82cf951cc12080fbb1 (patch)
tree1cd2d7c503a004c6ae9a4e56f066daaab3465d04 /src/modules
parentcf503f956071895b6e1d467afdc1e10382d60c87 (diff)
downloadpulseaudio-3977a906e21fe215051c0a82cf951cc12080fbb1.tar.gz
coreaudio: Catch devices with more channels than we support
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/macosx/module-coreaudio-device.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c
index aa299a0a3..6c9e55dd1 100644
--- a/src/modules/macosx/module-coreaudio-device.c
+++ b/src/modules/macosx/module-coreaudio-device.c
@@ -415,6 +415,11 @@ static int ca_device_create_sink(pa_module *m, AudioBuffer *buf, int channel_idx
AudioObjectPropertyAddress property_address;
CFStringRef tmp_cfstr = NULL;
+ if (buf->mNumberChannels > PA_CHANNELS_MAX) {
+ pa_log("Skipping device with more channels than we support (%u)", (unsigned int) buf->mNumberChannels);
+ return -1;
+ }
+
ca_sink = pa_xnew0(coreaudio_sink, 1);
ca_sink->map.channels = buf->mNumberChannels;
ca_sink->ss.channels = buf->mNumberChannels;
@@ -543,6 +548,11 @@ static int ca_device_create_source(pa_module *m, AudioBuffer *buf, int channel_i
AudioObjectPropertyAddress property_address;
CFStringRef tmp_cfstr = NULL;
+ if (buf->mNumberChannels > PA_CHANNELS_MAX) {
+ pa_log("Skipping device with more channels than we support (%u)", (unsigned int) buf->mNumberChannels);
+ return -1;
+ }
+
ca_source = pa_xnew0(coreaudio_source, 1);
ca_source->map.channels = buf->mNumberChannels;
ca_source->ss.channels = buf->mNumberChannels;