int len;
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
struct ast_srtp *srtp = ast_rtp_instance_get_srtp(instance);
+ char *in = buf;
if ((len = ast_recvfrom(rtcp ? rtp->rtcp->s : rtp->s, buf, size, flags, sa)) < 0) {
return len;
#ifdef HAVE_OPENSSL_SRTP
if (!rtcp) {
- char *in = buf;
-
dtls_srtp_check_pending(instance, rtp);
/* If this is an SSL packet pass it to OpenSSL for processing */
rtp->passthrough = 0;
}
- if (res_srtp && srtp && res_srtp->unprotect(srtp, buf, &len, rtcp) < 0) {
+ if ((*in > 1) && res_srtp && srtp && res_srtp->unprotect(srtp, buf, &len, rtcp) < 0) {
return -1;
}