diff rtsp.c @ 4898:609322be76a6 libavformat

Fix crash when receiving from SDP
author lucabe
date Mon, 20 Apr 2009 20:06:55 +0000
parents 940946a4569b
children 0b15fbb456f4
line wrap: on
line diff
--- a/rtsp.c	Sun Apr 19 21:24:36 2009 +0000
+++ b/rtsp.c	Mon Apr 20 20:06:55 2009 +0000
@@ -1375,8 +1375,13 @@
         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) {