diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index e2a105662260e5db094d60862eab181352f34516..bcb0b01230379f6ef2297b1b073ae48c30eb5b88 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3699,10 +3699,12 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
 		rtp->rxcount = 0;
 		rtp->cycles = 0;
 		rtp->lastrxseqno = 0;
-		rtp->rtcp->expected_prior = 0;
-		rtp->rtcp->received_prior = 0;
 		rtp->last_seqno = 0;
 		rtp->last_end_timestamp = 0;
+		if (rtp->rtcp) {
+			rtp->rtcp->expected_prior = 0;
+			rtp->rtcp->received_prior = 0;
+		}
 	}
 
 	rtp->rxssrc = ssrc;