From feed03ae4218dc7dffb4e4d113a643fd04faf6c3 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Fri, 11 May 2012 13:55:00 +0200 Subject: [PATCH] core: Add extra checks for Mute and Volume --- src/rygel/rygel-rendering-control.vala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/rygel/rygel-rendering-control.vala b/src/rygel/rygel-rendering-control.vala index b50240f..35ebce8 100644 --- a/src/rygel/rygel-rendering-control.vala +++ b/src/rygel/rygel-rendering-control.vala @@ -204,6 +204,14 @@ internal class Rygel.RenderingControl : Service { return; } + string mute_str; + action.get ("DesiredMute", typeof (string), out mute_str); + if (mute_str.has_prefix ("-")) { + action.return_error (501, _("ActionFailed")); + + return; + } + bool mute; action.get ("DesiredMute", typeof (bool), out mute); @@ -238,6 +246,14 @@ internal class Rygel.RenderingControl : Service { return; } + string volume_str; + action.get ("DesiredVolume", typeof (string), out volume_str); + if ("." in volume_str || "," in volume_str) { + action.return_error (501, _("ActionFailed")); + + return; + } + uint volume; action.get ("DesiredVolume", typeof (uint), out volume); -- 2.7.4