summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/http
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-05-07 12:07:31 -0700
committerChong Zhang <chz@google.com>2015-05-07 12:08:20 -0700
commit37d8b27e5470d8243288a87e90871efd43f29606 (patch)
tree9a653e7901c7f91cdaf06bf71269f873ffc2797f /media/libstagefright/http
parent32fa6d0e65dbf956e253a1006e9419dce2fe75c9 (diff)
downloadframeworks_av-37d8b27e5470d8243288a87e90871efd43f29606.zip
frameworks_av-37d8b27e5470d8243288a87e90871efd43f29606.tar.gz
frameworks_av-37d8b27e5470d8243288a87e90871efd43f29606.tar.bz2
MediaHTTP: add more null ptr and init checks
bug: 20912192 Change-Id: I83cf59ff85fd8aa3a19a696ceb97cd8aa922b8ba
Diffstat (limited to 'media/libstagefright/http')
-rw-r--r--media/libstagefright/http/MediaHTTP.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/media/libstagefright/http/MediaHTTP.cpp b/media/libstagefright/http/MediaHTTP.cpp
index bb89567..2d9b3d4 100644
--- a/media/libstagefright/http/MediaHTTP.cpp
+++ b/media/libstagefright/http/MediaHTTP.cpp
@@ -30,12 +30,11 @@
namespace android {
MediaHTTP::MediaHTTP(const sp<IMediaHTTPConnection> &conn)
- : mInitCheck(NO_INIT),
+ : mInitCheck((conn != NULL) ? OK : NO_INIT),
mHTTPConnection(conn),
mCachedSizeValid(false),
mCachedSize(0ll),
mDrmManagerClient(NULL) {
- mInitCheck = OK;
}
MediaHTTP::~MediaHTTP() {
@@ -171,6 +170,10 @@ void MediaHTTP::getDrmInfo(
}
String8 MediaHTTP::getUri() {
+ if (mInitCheck != OK) {
+ return String8::empty();
+ }
+
String8 uri;
if (OK == mHTTPConnection->getUri(&uri)) {
return uri;