aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-22 00:53:25 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-22 00:53:25 +0000
commit3ccc3c27e6663df00ffed181941a4e50665c7dbc (patch)
treeff8d4983483501716252d362c080741741c75bce
parent46dd64aaef844a2202c707c6f6f926abb65ac123 (diff)
If we receive a frame that is not in any of the negotiated formats, then drop
it. (potentially issue #8781 and SPD-12) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@56010 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 577ac71e8..594f5e6a9 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3043,6 +3043,11 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
/* We already hold the channel lock */
if (f->frametype == AST_FRAME_VOICE) {
if (f->subclass != p->owner->nativeformats) {
+ if (!(f->subclass & p->jointcapability)) {
+ ast_log(LOG_DEBUG, "Bogus frame of format '%s' received from '%s'!\n",
+ ast_getformatname(f->subclass), p->owner->name);
+ return &null_frame;
+ }
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
p->owner->nativeformats = f->subclass;
ast_set_read_format(p->owner, p->owner->readformat);