commit | a02d9bf9c3ff22cd449da21ff7c23170488ebd8e | [log] [tgz] |
---|---|---|
author | Marco Nelissen <marcone@google.com> | Thu Jun 09 09:39:52 2011 -0700 |
committer | Marco Nelissen <marcone@google.com> | Thu Jun 09 09:39:52 2011 -0700 |
tree | 3e51ceb093702d5f700e7b6dc207acba38d6912d | |
parent | 19974eccdbd3e4dbd7e3b2cc401db7806d4a17bc [diff] |
Make sure we don't read from invalid fds b/4580570 Change-Id: I622f001551a404a7a840d8388a9febac2db107ad
diff --git a/media/libstagefright/HTTPStream.cpp b/media/libstagefright/HTTPStream.cpp index 4c322bf..42664b2 100644 --- a/media/libstagefright/HTTPStream.cpp +++ b/media/libstagefright/HTTPStream.cpp
@@ -130,6 +130,9 @@ 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);