Hi,
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
Regards,
Steve
This should now be fixed in CVS.