From 593bd41ed861d80f498fa8cfe0cea06e0c11f442 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sun, 1 Feb 2009 19:26:18 -0800 Subject: Fix setting revents in bluetooth_playback_poll_revents This fix will unfortunately break any applications that make use of snd_pcm_wait (audacious is one of them). However, without this fix most applications using snd_pcm_poll_descriptors_revents will cause access to invalid memory as they only pass a single integer (while snd_pcm_wait_nocheck passes a full array). The following thread on the alsa mailing list has more information: http://mailman.alsa-project.org/pipermail/alsa-devel/2009-February/014392.html --- audio/pcm_bluetooth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c index dfdd1ef5..9bef89e2 100644 --- a/audio/pcm_bluetooth.c +++ b/audio/pcm_bluetooth.c @@ -797,8 +797,7 @@ static int bluetooth_playback_poll_revents(snd_pcm_ioplug_t *io, if (pfds[1].revents & (POLLERR | POLLHUP | POLLNVAL)) io->state = SND_PCM_STATE_DISCONNECTED; - revents[0] = (pfds[0].revents & ~POLLIN) | POLLOUT; - revents[1] = (pfds[1].revents & ~POLLIN); + *revents = (pfds[0].revents & POLLIN) ? POLLOUT : 0; return 0; } -- cgit