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:
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user