rtsp: Don't use uninitialized data if there are no streams
authorMartin Storsjö <martin@martin.st>
Fri, 6 Apr 2012 19:35:48 +0000 (22:35 +0300)
committerMartin Storsjö <martin@martin.st>
Sun, 8 Apr 2012 12:51:32 +0000 (15:51 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtsp.c

index 403f038..9ee7a75 100644 (file)
@@ -1391,7 +1391,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
             goto fail;
     }
 
-    if (reply->timeout > 0)
+    if (rt->nb_rtsp_streams && reply->timeout > 0)
         rt->timeout = reply->timeout;
 
     if (rt->server_type == RTSP_SERVER_REAL)