From: Mark Michelson Date: Fri, 31 Aug 2012 21:15:07 +0000 (+0000) Subject: Prevent local RTP bridges from sending inappropriate formats to participants. X-Git-Tag: 13.0.0-beta1~2592 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7ef4698261752b279bb4ee51a4f0b32b2531bd5;p=thirdparty%2Fasterisk.git Prevent local RTP bridges from sending inappropriate formats to participants. A change for Asterisk 11 caused a check for failure to incorrectly check the return value. This resulted in the possibility of transmitting media that a party had not negotiated. If this media happened to be G.729, then this could potentially result in one-way audio if no G.729 translators are installed. (closes issue ASTERISK-20296) reported by NITESH BANSAL ........ Merged revisions 372118 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372119 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index aa7895bb23..fad313c2b6 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -2789,7 +2789,7 @@ static int bridge_p2p_rtp_write(struct ast_rtp_instance *instance, unsigned int } /* If the payload coming in is not one of the negotiated ones then send it to the core, this will cause formats to change and the bridge to break */ - if (!ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(instance1), 0, NULL, bridged_payload) && + if ((ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(instance1), 0, NULL, bridged_payload) == -1) && !ast_rtp_codecs_get_payload_format(ast_rtp_instance_get_codecs(instance1), bridged_payload)) { return -1; }