Fix for bug 3477330

This patch fixs a crash bug caused by using a NULL DecryptHandle pointer in the DRM Framework.
Fix by using sp<DecryptHandle> instead.

Change-Id: I1355d4719857ab64ad6cd12803fcf19e45bb50a0
This commit is contained in:
Gloria Wang
2011-02-25 09:47:52 -08:00
parent cf1d556195
commit 14761c80a9
3 changed files with 16 additions and 3 deletions

View File

@@ -32,7 +32,7 @@
using namespace android;
static DecryptHandle *sDecryptHandle;
static sp<DecryptHandle> sDecryptHandle;
static DrmManagerClient *sDrmManagerClient;
@@ -86,7 +86,7 @@ WVMExtractorImpl::WVMExtractorImpl(sp<DataSource> dataSource)
mSession(NULL),
mSetupStatus(OK)
{
dataSource->getDrmInfo(&sDecryptHandle, &sDrmManagerClient);
dataSource->getDrmInfo(sDecryptHandle, &sDrmManagerClient);
// Set up callouts
AndroidSetLogCallout(android_printbuf);
@@ -134,6 +134,14 @@ WVMExtractorImpl::WVMExtractorImpl(sp<DataSource> dataSource)
WVMExtractorImpl::~WVMExtractorImpl() {
}
// Release decrypt handle when media sources are destroyed
void WVMExtractorImpl::cleanup()
{
if (sDecryptHandle.get()) {
sDecryptHandle.clear();
}
}
//
// Configure metadata for video and audio sources
//