From 74ef8b434d8d8ef02bee6a5394da849136ed1bf1 Mon Sep 17 00:00:00 2001 From: Eric Paul <[eric.paul@gmail.com> Date: Thu, 5 Jul 2007 20:58:34 +0000 Subject: check udp_read_packet return value not to access uninitialized memory patch by Eric Paul: [eric paul gmail com] original thread: [FFmpeg-devel] [PATCH] : libavformat segfault when a RTSP reading is interrupted date: 07/05/2007 03:13 PM Originally committed as revision 9492 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rtsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/rtsp.c') 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; } -- cgit v1.2.3