[vlc-commits] stream_filter: dash: don't try to close invalid fd

Francois Cartegnie git at videolan.org
Thu Dec 18 22:39:45 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 18 15:25:37 2014 +0100| [2632d19a1b2b68011806e8d3a2c807f899023485] | committer: Francois Cartegnie

stream_filter: dash: don't try to close invalid fd

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2632d19a1b2b68011806e8d3a2c807f899023485
---

 modules/stream_filter/dash/http/HTTPConnection.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/stream_filter/dash/http/HTTPConnection.cpp b/modules/stream_filter/dash/http/HTTPConnection.cpp
index cc157e4..847ccf6 100644
--- a/modules/stream_filter/dash/http/HTTPConnection.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnection.cpp
@@ -30,6 +30,7 @@
 using namespace dash::http;
 
 HTTPConnection::HTTPConnection  (stream_t *stream) :
+                httpSocket      (-1),
                 stream          (stream),
                 peekBufferLen   (0),
                 contentLength   (0)
@@ -166,7 +167,8 @@ bool            HTTPConnection::sendData        (const std::string& data)
 }
 void            HTTPConnection::closeSocket     ()
 {
-    net_Close(this->httpSocket);
+    if (httpSocket >= 0)
+        net_Close(httpSocket);
 }
 bool            HTTPConnection::setUrlRelative  (Chunk *chunk)
 {



More information about the vlc-commits mailing list