From a2608a2bb76c0d583dd249a37923da2c0bfc6d51 Mon Sep 17 00:00:00 2001 From: Richard Aas Date: Tue, 27 Oct 2015 09:49:59 +0000 Subject: [PATCH] srtp: return ENOSR upon stream failures --- src/srtp/srtcp.c | 4 ++-- src/srtp/srtp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/srtp/srtcp.c b/src/srtp/srtcp.c index ee4fcc8..23f48f4 100644 --- a/src/srtp/srtcp.c +++ b/src/srtp/srtcp.c @@ -49,7 +49,7 @@ int srtcp_encrypt(struct srtp *srtp, struct mbuf *mb) strm = stream_get(srtp, ssrc); if (!strm) - return ENOMEM; + return ENOSR; strm->rtcp_index = (strm->rtcp_index+1) & 0x7fffffff; @@ -118,7 +118,7 @@ int srtcp_decrypt(struct srtp *srtp, struct mbuf *mb) strm = stream_get(srtp, ssrc); if (!strm) - return ENOMEM; + return ENOSR; pld_start = mb->pos; diff --git a/src/srtp/srtp.c b/src/srtp/srtp.c index 9382a8c..3cfc1c7 100644 --- a/src/srtp/srtp.c +++ b/src/srtp/srtp.c @@ -165,7 +165,7 @@ int srtp_encrypt(struct srtp *srtp, struct mbuf *mb) strm = stream_get_seq(srtp, hdr.ssrc, hdr.seq); if (!strm) - return ENOMEM; + return ENOSR; /* Roll-Over Counter (ROC) */ if (seq_diff(strm->s_l, hdr.seq) <= -32768) { @@ -243,7 +243,7 @@ int srtp_decrypt(struct srtp *srtp, struct mbuf *mb) strm = stream_get_seq(srtp, hdr.ssrc, hdr.seq); if (!strm) - return ENOMEM; + return ENOSR; diff = seq_diff(strm->s_l, hdr.seq); if (diff > 32768)