summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-01 19:26:18 -0800
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-01 19:26:18 -0800
commit593bd41ed861d80f498fa8cfe0cea06e0c11f442 (patch)
treed8b9ec6b102136c2cc7e6c87f3a78ddf5ee6df55 /audio
parent2c341754c0900de781062893636cee016760c1ed (diff)
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
Diffstat (limited to 'audio')
-rw-r--r--audio/pcm_bluetooth.c3
1 files changed, 1 insertions, 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;
}