summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 3a3ffbd13d..2607fe0409 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1194,7 +1194,7 @@ static int rtsp_read_packet(AVFormatContext *s,
case RTSP_PROTOCOL_RTP_UDP:
case RTSP_PROTOCOL_RTP_UDP_MULTICAST:
len = udp_read_packet(s, &rtsp_st, buf, sizeof(buf));
- if (rtsp_st->rtp_ctx)
+ if (len >=0 && rtsp_st->rtp_ctx)
rtp_check_and_send_back_rr(rtsp_st->rtp_ctx, len);
break;
}