diff options
author | Chong Zhang <chz@google.com> | 2014-09-23 15:49:03 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-23 15:49:03 +0000 |
commit | b4c27684ac4b33adb52a8977d5bf386d8d1cf933 (patch) | |
tree | 37ca642f50a733236ecd8b8a301cb2ade1f5f20e /media/libstagefright | |
parent | 0f5aa41c4701e66a57291007f7f72bc32bf5451b (diff) | |
parent | a44d8f71a4b9ebae87c386bc3fe19abc52590bb5 (diff) | |
download | frameworks_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.cpp | 13 |
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) { |