Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion srtp/srtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@ srtp_err_status_t srtp_protect_mki(srtp_ctx_t *ctx,
*/
stream = srtp_get_stream(ctx, hdr->ssrc);
if (stream == NULL) {
if (ctx->stream_template != NULL) {
if ((ctx->stream_template != NULL) && (ctx->stream_template->direction != dir_srtp_receiver)) {
srtp_stream_ctx_t *new_stream;

/* allocate and initialize a new stream */
Expand Down Expand Up @@ -2465,6 +2465,10 @@ srtp_err_status_t srtp_unprotect_mki(srtp_ctx_t *ctx,
stream = srtp_get_stream(ctx, hdr->ssrc);
if (stream == NULL) {
if (ctx->stream_template != NULL) {
if (ctx->stream_template->direction == dir_srtp_sender) {
return srtp_err_status_no_ctx;
}

stream = ctx->stream_template;
debug_print(mod_srtp, "using provisional stream (SSRC: 0x%08x)",
ntohl(hdr->ssrc));
Expand Down