summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2014-09-22 22:17:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-22 22:17:30 +0000
commita44d8f71a4b9ebae87c386bc3fe19abc52590bb5 (patch)
treeb71ad508f13d70921720529e6c4c0b8f33138800 /media/libstagefright
parentd7f77cd78f5180ba7a04b270d632cc4f9f11718a (diff)
parent217bde880be6f4d937caf9555ea98942883ebda0 (diff)
downloadframeworks_av-a44d8f71a4b9ebae87c386bc3fe19abc52590bb5.zip
frameworks_av-a44d8f71a4b9ebae87c386bc3fe19abc52590bb5.tar.gz
frameworks_av-a44d8f71a4b9ebae87c386bc3fe19abc52590bb5.tar.bz2
Merge "fix crash when makeHTTPConnection fails with null pointer" into lmp-dev
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/DataSource.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp
index 9d6fd78..a72cbd5 100644
--- a/media/libstagefright/DataSource.cpp
+++ b/media/libstagefright/DataSource.cpp
@@ -199,7 +199,18 @@ sp<DataSource> DataSource::CreateFromURI(
} else if (!strncasecmp("http://", uri, 7)
|| !strncasecmp("https://", uri, 8)
|| isWidevine) {
- sp<HTTPBase> httpSource = new MediaHTTP(httpService->makeHTTPConnection());
+ if (httpService == NULL) {
+ ALOGE("Invalid http service!");
+ return NULL;
+ }
+
+ sp<IMediaHTTPConnection> conn = httpService->makeHTTPConnection();
+ if (conn == NULL) {
+ ALOGE("Failed to make http connection from http service!");
+ return NULL;
+ }
+
+ sp<HTTPBase> httpSource = new MediaHTTP(conn);
String8 tmp;
if (isWidevine) {