diff options
author | Michal Ratajsky <[email protected]> | 2014-10-27 21:31:47 +0100 |
---|---|---|
committer | Michal Ratajsky <[email protected]> | 2014-10-27 21:31:47 +0100 |
commit | c01a3b2c1c4e6f82d45c5f66c5d97cce704c7371 (patch) | |
tree | 3b9698aede198a9d7900d5383eab95019755815c /backends/alsa/alsa-device.c | |
parent | 9f2c0bedf4cbe4152e449454d659ea907fa00246 (diff) | |
download | libmatemixer-c01a3b2c1c4e6f82d45c5f66c5d97cce704c7371.tar.bz2 libmatemixer-c01a3b2c1c4e6f82d45c5f66c5d97cce704c7371.tar.xz |
alsa: Make sure not to create empty switches
Diffstat (limited to 'backends/alsa/alsa-device.c')
-rw-r--r-- | backends/alsa/alsa-device.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/backends/alsa/alsa-device.c b/backends/alsa/alsa-device.c index 03dd7c0..243e4ad 100644 --- a/backends/alsa/alsa-device.c +++ b/backends/alsa/alsa-device.c @@ -669,6 +669,9 @@ add_switch (AlsaDevice *device, AlsaStream *stream, snd_mixer_elem_t *el) g_warning ("Failed to read switch item name: %s", snd_strerror (ret)); } + if G_UNLIKELY (options == NULL) + return FALSE; + get_switch_info (el, &name, &label, &role); /* Takes ownership of options */ |