diff options
author | Luca Abeni <lucabe72@email.it> | 2009-04-20 20:06:55 +0000 |
---|---|---|
committer | Luca Abeni <lucabe72@email.it> | 2009-04-20 20:06:55 +0000 |
commit | 46ff7a5f4ae05e5e4da33b700604dae2c37bebcb (patch) | |
tree | 0f2a8b37fbe0d0595270621ff0115d8899c25331 | |
parent | 0a044f0f0634362f03bfd8e2bc9d273a71ea22e2 (diff) | |
download | ffmpeg-46ff7a5f4ae05e5e4da33b700604dae2c37bebcb.tar.gz |
Fix crash when receiving from SDP
Originally committed as revision 18635 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/rtsp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 9a4b1e2c49..c67991a5c1 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1375,8 +1375,13 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, if (url_interrupt_cb()) return AVERROR(EINTR); FD_ZERO(&rfds); - tcp_fd = fd_max = url_get_file_handle(rt->rtsp_hd); - FD_SET(tcp_fd, &rfds); + if (rt->rtsp_hd) { + tcp_fd = fd_max = url_get_file_handle(rt->rtsp_hd); + FD_SET(tcp_fd, &rfds); + } else { + fd_max = 0; + tcp_fd = -1; + } for(i = 0; i < rt->nb_rtsp_streams; i++) { rtsp_st = rt->rtsp_streams[i]; if (rtsp_st->rtp_handle) { |