From c01a3b2c1c4e6f82d45c5f66c5d97cce704c7371 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Mon, 27 Oct 2014 21:31:47 +0100 Subject: alsa: Make sure not to create empty switches --- backends/alsa/alsa-device.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends') 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 */ -- cgit v1.2.1