[pulseaudio-commits] src/modules

Colin Guthrie colin at kemper.freedesktop.org
Sun Sep 4 03:54:49 PDT 2011


 src/modules/module-stream-restore.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit 2b96fdfd2501d7c4728d506a33ecc4575ac66f48
Author: Colin Guthrie <colin at mageia.org>
Date:   Sun Sep 4 12:54:41 2011 +0200

    stream-restore: Add proper data validity checks to the legacy database entry read.

diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 22659df..4d0686f 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -1077,6 +1077,26 @@ static struct entry* legacy_entry_read(struct userdata *u, pa_datum *data) {
         return NULL;
     }
 
+    if (le->device_valid && !pa_namereg_is_valid_name(le->device)) {
+        pa_log_warn("Invalid device name stored in database for legacy stream");
+        return NULL;
+    }
+
+    if (le->card_valid && !pa_namereg_is_valid_name(le->card)) {
+        pa_log_warn("Invalid card name stored in database for legacy stream");
+        return NULL;
+    }
+
+    if (le->volume_valid && !pa_channel_map_valid(&le->channel_map)) {
+        pa_log_warn("Invalid channel map stored in database for legacy stream");
+        return NULL;
+    }
+
+    if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
+        pa_log_warn("Invalid volume stored in database for legacy stream");
+        return NULL;
+    }
+
     e = entry_new();
     e->muted_valid = le->muted_valid;
     e->muted = le->muted;



More information about the pulseaudio-commits mailing list