summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/modules/alsa/alsa-util.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index c53fd10d..a0907c4d 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -113,7 +113,7 @@ static void io_cb(pa_mainloop_api*a, pa_io_event* e, int fd, pa_io_event_flags_t
static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
struct pa_alsa_fdlist *fdl = userdata;
unsigned num_fds, i;
- int err;
+ int err, n;
struct pollfd *temp;
pa_assert(a);
@@ -122,7 +122,11 @@ static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
a->defer_enable(fdl->defer, 0);
- num_fds = (unsigned) snd_mixer_poll_descriptors_count(fdl->mixer);
+ if ((n = snd_mixer_poll_descriptors_count(fdl->mixer)) < 0) {
+ pa_log("snd_mixer_poll_descriptors_count() failed: %s", snd_strerror(n));
+ return;
+ }
+ num_fds = (unsigned) n;
if (num_fds != fdl->num_fds) {
if (fdl->fds)