From a02d9bf9c3ff22cd449da21ff7c23170488ebd8e Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Thu, 9 Jun 2011 09:39:52 -0700 Subject: [PATCH] Make sure we don't read from invalid fds b/4580570 Change-Id: I622f001551a404a7a840d8388a9febac2db107ad --- media/libstagefright/HTTPStream.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/media/libstagefright/HTTPStream.cpp b/media/libstagefright/HTTPStream.cpp index 4c322bfeb9c90..42664b2b34ce5 100644 --- a/media/libstagefright/HTTPStream.cpp +++ b/media/libstagefright/HTTPStream.cpp @@ -130,6 +130,9 @@ static ssize_t MySendReceive( int s, void *data, size_t size, int flags, bool sendData) { ssize_t result = 0; + if (s < 0) { + return -1; + } while (size > 0) { fd_set rs, ws, es; FD_ZERO(&rs);