summaryrefslogtreecommitdiff
path: root/backends/alsa/alsa-device.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-10-27 21:31:47 +0100
committerMichal Ratajsky <[email protected]>2014-10-27 21:31:47 +0100
commitc01a3b2c1c4e6f82d45c5f66c5d97cce704c7371 (patch)
tree3b9698aede198a9d7900d5383eab95019755815c /backends/alsa/alsa-device.c
parent9f2c0bedf4cbe4152e449454d659ea907fa00246 (diff)
downloadlibmatemixer-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.c3
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 */