]> git.sesse.net Git - ffmpeg/commitdiff
Fix crash when receiving from SDP
authorLuca Abeni <lucabe72@email.it>
Mon, 20 Apr 2009 20:06:55 +0000 (20:06 +0000)
committerLuca Abeni <lucabe72@email.it>
Mon, 20 Apr 2009 20:06:55 +0000 (20:06 +0000)
Originally committed as revision 18635 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/rtsp.c

index 9a4b1e2c490597ed3b565ae54a0d074d802d6b83..c67991a5c1ab955f1d2f22f719d36bdb67637ed7 100644 (file)
@@ -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) {