bug in srtp_remove_stream
http://sourceforge.net/tracker/?func=detail&aid=2192597&group_id=38894&atid=423799
I found a bug in srtp_remove_stream.
This: /* remove stream from the list */ last_stream->next = stream->next;
Does not work if there is only one stream in the list. You need something like: /* remove stream from the list */ if (last_stream == stream){ // only one stream in list session->stream_list = stream->next; } else { last_stream->next = stream->next; }
The following pseudo-code uncovered this problem: srtp_t srtpSession; srtp_policy_t srtpPolicy; srtp_init(); srtp_create(&srtpSession, NULL); srtp_add_stream(srtpSession, &srtpPolicy); srtp_remove_stream(srtpSession, the_ssrc); srtp_dealloc(srtpSession); Memory fault
Looks like this is already in head. This can be closed.