diff options
author | Gloria Wang <gwang@google.com> | 2011-02-24 16:40:57 -0800 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-03-10 16:20:48 -0800 |
commit | b5ce361d19e69fe156f7188c9ee0f4734b259874 (patch) | |
tree | 1536e63d3394cbbd5c2e8bc5cde6affb2b173850 /media/libstagefright/DRMExtractor.cpp | |
parent | 609ce04d29780c430ff7e17511fc073a664c02d5 (diff) | |
download | frameworks_av-b5ce361d19e69fe156f7188c9ee0f4734b259874.zip frameworks_av-b5ce361d19e69fe156f7188c9ee0f4734b259874.tar.gz frameworks_av-b5ce361d19e69fe156f7188c9ee0f4734b259874.tar.bz2 |
Fix for bug 3477330
This patch fixs a crash bug caused by using a NULL DecryptHandle pointer.
Fix by using sp<DecryptHandle> instead.
Change-Id: Icbd59858385e8256125a615a3c82656b25319d44
Diffstat (limited to 'media/libstagefright/DRMExtractor.cpp')
-rw-r--r-- | media/libstagefright/DRMExtractor.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/media/libstagefright/DRMExtractor.cpp b/media/libstagefright/DRMExtractor.cpp index 2809df5..c4ed516 100644 --- a/media/libstagefright/DRMExtractor.cpp +++ b/media/libstagefright/DRMExtractor.cpp @@ -41,7 +41,7 @@ namespace android { class DRMSource : public MediaSource { public: DRMSource(const sp<MediaSource> &mediaSource, - DecryptHandle *decryptHandle, + const sp<DecryptHandle> &decryptHandle, DrmManagerClient *managerClient, int32_t trackId, DrmBuffer *ipmpBox); @@ -56,7 +56,7 @@ protected: private: sp<MediaSource> mOriginalMediaSource; - DecryptHandle* mDecryptHandle; + sp<DecryptHandle> mDecryptHandle; DrmManagerClient* mDrmManagerClient; size_t mTrackId; mutable Mutex mDRMLock; @@ -70,7 +70,7 @@ private: //////////////////////////////////////////////////////////////////////////////// DRMSource::DRMSource(const sp<MediaSource> &mediaSource, - DecryptHandle *decryptHandle, + const sp<DecryptHandle> &decryptHandle, DrmManagerClient *managerClient, int32_t trackId, DrmBuffer *ipmpBox) : mOriginalMediaSource(mediaSource), @@ -245,7 +245,7 @@ DRMExtractor::DRMExtractor(const sp<DataSource> &source, const char* mime) mOriginalExtractor->setDrmFlag(true); mOriginalExtractor->getMetaData()->setInt32(kKeyIsDRM, 1); - source->getDrmInfo(&mDecryptHandle, &mDrmManagerClient); + source->getDrmInfo(mDecryptHandle, &mDrmManagerClient); } DRMExtractor::~DRMExtractor() { @@ -281,7 +281,7 @@ sp<MetaData> DRMExtractor::getMetaData() { bool SniffDRM( const sp<DataSource> &source, String8 *mimeType, float *confidence, sp<AMessage> *) { - DecryptHandle *decryptHandle = source->DrmInitialization(); + sp<DecryptHandle> decryptHandle = source->DrmInitialization(); if (decryptHandle != NULL) { if (decryptHandle->decryptApiType == DecryptApiType::CONTAINER_BASED) { |