diff options
author | Ben Ford <bford@digium.com> | 2017-09-15 09:43:21 -0500 |
---|---|---|
committer | Benjamin Keith Ford <bford@digium.com> | 2017-09-20 12:14:45 -0500 |
commit | e666051d790bb2a9d1e9ff6bb11bd69db6e0efba (patch) | |
tree | fbaff373e27c9c3d2d739a5d6e2fc4eec514b026 /res/res_pjsip_sdp_rtp.c | |
parent | 8830cc05415c0d18ea1a10a43173fb20f79d8f8c (diff) |
res_pjsip_session: Check for removed stream state.
When a sip session is refreshed, the stream topology is looped
through, checking each stream for compatible formats. This would
cause a crash if the stream state was AST_STREAM_STATE_REMOVED,
since the formats would never be set for this stream, causing
a NULL value to be returned from ast_stream_get_formats. This
commit adds a check for streams with removed states.
Also removed a stray semicolon.
Change-Id: Ic86f8b65a4a26a60885b28b8b1a0b22e1b471d42
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r-- | res/res_pjsip_sdp_rtp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index e095f0660..8ec57aa8e 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -1338,7 +1338,7 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as media->desc.port = 0; media->desc.port_count = 1; - if (remote) { + if (remote && remote->media[ast_stream_get_position(stream)]) { pjmedia_sdp_media *remote_media = remote->media[ast_stream_get_position(stream)]; int index; |