summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2014-09-23 15:49:03 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-23 15:49:03 +0000
commitb4c27684ac4b33adb52a8977d5bf386d8d1cf933 (patch)
tree37ca642f50a733236ecd8b8a301cb2ade1f5f20e /media/libstagefright
parent0f5aa41c4701e66a57291007f7f72bc32bf5451b (diff)
parenta44d8f71a4b9ebae87c386bc3fe19abc52590bb5 (diff)
downloadframeworks_av-b4c27684ac4b33adb52a8977d5bf386d8d1cf933.zip
frameworks_av-b4c27684ac4b33adb52a8977d5bf386d8d1cf933.tar.gz
frameworks_av-b4c27684ac4b33adb52a8977d5bf386d8d1cf933.tar.bz2
am a44d8f71: Merge "fix crash when makeHTTPConnection fails with null pointer" into lmp-dev
* commit 'a44d8f71a4b9ebae87c386bc3fe19abc52590bb5': fix crash when makeHTTPConnection fails with null pointer
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) {