mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
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
This commit is contained in:
committed by
Benjamin Keith Ford
parent
8830cc0541
commit
e666051d79
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user