summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorEric Paul <[eric.paul@gmail.com>2007-07-05 20:58:34 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-07-05 20:58:34 +0000
commit74ef8b434d8d8ef02bee6a5394da849136ed1bf1 (patch)
tree6921ab8c24ed0a920d0a0c19da9a70e21c53d718 /libavformat/rtsp.c
parent3caffb7d80f20c66d7d582ca3d23f80ad373ba0a (diff)
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
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;
}