]> granicus.if.org Git - rtmpdump/commitdiff
Check for valid socket before setting in fdset
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Mon, 22 Mar 2010 03:38:13 +0000 (03:38 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Mon, 22 Mar 2010 03:38:13 +0000 (03:38 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@382 400ebc74-4327-4243-bc38-086b20814532

rtmpsuck.c

index 23a9aecc92e65b09c415cf074e3716e17a394850..e77019afecff23671fdf90093189d61666cbe4c7 100644 (file)
@@ -803,9 +803,11 @@ void doServe(STREAMING_SERVER * server,    // server socket and state (our listenin
              RTMP_Log(RTMP_LOGERROR, "Request timeout/select failed, ignoring request");
              goto cleanup;
            }
-          if (FD_ISSET(server->rs.m_sb.sb_socket, &rfds))
+          if (server->rs.m_sb.sb_socket > 0 &&
+           FD_ISSET(server->rs.m_sb.sb_socket, &rfds))
             sr = 1;
-          if (FD_ISSET(server->rc.m_sb.sb_socket, &rfds))
+          if (server->rc.m_sb.sb_socket > 0 &&
+           FD_ISSET(server->rc.m_sb.sb_socket, &rfds))
             cr = 1;
         }
       if (sr)