[spice-server v2 03/10] sound: Add sanity checks in snd_{playback, record}_send

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Filter out commands which should not happen. Should it be a
g_warn_if_fail() or such instead?

Based on a patch from Frediano Ziglio <fziglio@xxxxxxxxxx>

Signed-off-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
---
 server/sound.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/sound.c b/server/sound.c
index 1f88149..a53ebcd 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -851,6 +851,9 @@ static void snd_playback_send(void* data)
         return;
     }
 
+    client->command &= SND_PLAYBACK_MODE_MASK|SND_PLAYBACK_PCM_MASK|
+                       SND_CTRL_MASK|SND_VOLUME_MUTE_MASK|
+                       SND_MIGRATE_MASK|SND_PLAYBACK_LATENCY_MASK;
     while (client->command) {
         if (client->command & SND_PLAYBACK_MODE_MASK) {
             if (!playback_send_mode(playback_client)) {
@@ -910,6 +913,7 @@ static void snd_record_send(void* data)
         return;
     }
 
+    client->command &= SND_CTRL_MASK|SND_VOLUME_MUTE_MASK|SND_MIGRATE_MASK;
     while (client->command) {
         if (client->command & SND_CTRL_MASK) {
             if (!snd_record_send_ctl(record_client)) {
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]