AST-2018-001: rtp / channel: Don't allow an unnegotiated format to be passed up.

When an RTP packet is received by an RTP engine it has to map the
payload into the Asterisk format. The code was incorrectly checking
our own static list for ALL payloads if it couldn't find a negotiated one.
This included dynamic payloads. If the payload mapped to a format
of a different type (for example receiving a video packet on an audio
RTP instance) then the core stream code could cause a crash if a legacy
channel driver was in use as no stream would be present.

To provide further protection the core stream code will no longer assume
that a video or audio frame will always have a stream for legacy channel
drivers. If no stream is present the frame is dropped.

ASTERISK-27488

Change-Id: I022556f524ad8379ee73f14037040af17ea3316a
This commit is contained in:
Joshua Colp
2018-01-13 14:04:33 +00:00
parent a1e6320c4a
commit e70c4ec84d
2 changed files with 18 additions and 3 deletions

View File

@@ -1216,7 +1216,7 @@ struct ast_rtp_payload_type *ast_rtp_codecs_get_payload(struct ast_rtp_codecs *c
}
ast_rwlock_unlock(&codecs->codecs_lock);
if (!type) {
if (!type && payload <= AST_RTP_PT_LAST_STATIC) {
ast_rwlock_rdlock(&static_RTP_PT_lock);
type = ao2_bump(static_RTP_PT[payload]);
ast_rwlock_unlock(&static_RTP_PT_lock);