Don't try to read from an rtcp if there isn't one
[asterisk/asterisk.git] / rtp.c
diff --git a/rtp.c b/rtp.c
index a9ecd34..ea0523c 100755 (executable)
--- a/rtp.c
+++ b/rtp.c
@@ -325,7 +325,7 @@ struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
        unsigned int rtcpdata[1024];
        char iabuf[INET_ADDRSTRLEN];
        
-       if (!rtp)
+       if (!rtp || !rtp->rtcp)
                return &null_frame;
 
        len = sizeof(sin);