From 55226ebcce855eb204446e140bd66c2fdd511a3d Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Thu, 26 Feb 2009 18:08:44 +0000 Subject: [PATCH] Don't let the other side change content's media type --- src/jingle-media-rtp.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/jingle-media-rtp.c b/src/jingle-media-rtp.c index 7e1ca42..f3a0534 100644 --- a/src/jingle-media-rtp.c +++ b/src/jingle-media-rtp.c @@ -354,6 +354,20 @@ parse_description (GabbleJingleContent *content, /* FIXME: we ignore "profile" attribute */ + if (priv->media_type != JINGLE_MEDIA_TYPE_NONE) + { + if (mtype != priv->media_type) + { + DEBUG ("...but this content has type %u!", priv->media_type); + SET_BAD_REQ ("media type incorrect"); + return; + } + } + else + { + priv->media_type = mtype; + } + for (node = desc_node->children; node; node = node->next) { if (tp_strdiff (lm_message_node_get_name (node), "payload-type")) @@ -375,8 +389,6 @@ parse_description (GabbleJingleContent *content, return; } - priv->media_type = mtype; - DEBUG ("emitting remote-codecs signal"); g_signal_emit (self, signals[REMOTE_CODECS], 0, codecs); -- 1.6.1.3