mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1143278 - Add more null checks in gmp-clearkey's decoders. r=edwin
This commit is contained in:
parent
e61fe5c00d
commit
bdd3e51ab8
@ -36,7 +36,9 @@ AudioDecoder::AudioDecoder(GMPAudioHost *aHostAPI)
|
||||
|
||||
AudioDecoder::~AudioDecoder()
|
||||
{
|
||||
mMutex->Destroy();
|
||||
if (mMutex) {
|
||||
mMutex->Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -223,8 +225,12 @@ AudioDecoder::MFToGMPSample(IMFSample* aInput,
|
||||
void
|
||||
AudioDecoder::Reset()
|
||||
{
|
||||
mDecoder->Reset();
|
||||
mCallback->ResetComplete();
|
||||
if (mDecoder) {
|
||||
mDecoder->Reset();
|
||||
}
|
||||
if (mCallback) {
|
||||
mCallback->ResetComplete();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -248,6 +254,9 @@ AudioDecoder::DrainTask()
|
||||
void
|
||||
AudioDecoder::Drain()
|
||||
{
|
||||
if (!mDecoder) {
|
||||
return;
|
||||
}
|
||||
EnsureWorker();
|
||||
mWorkerThread->Post(WrapTask(this,
|
||||
&AudioDecoder::DrainTask));
|
||||
|
@ -39,7 +39,9 @@ VideoDecoder::VideoDecoder(GMPVideoHost *aHostAPI)
|
||||
|
||||
VideoDecoder::~VideoDecoder()
|
||||
{
|
||||
mMutex->Destroy();
|
||||
if (mMutex) {
|
||||
mMutex->Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -330,8 +332,12 @@ VideoDecoder::SampleToVideoFrame(IMFSample* aSample,
|
||||
void
|
||||
VideoDecoder::Reset()
|
||||
{
|
||||
mDecoder->Reset();
|
||||
mCallback->ResetComplete();
|
||||
if (mDecoder) {
|
||||
mDecoder->Reset();
|
||||
}
|
||||
if (mCallback) {
|
||||
mCallback->ResetComplete();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -361,6 +367,12 @@ VideoDecoder::DrainTask()
|
||||
void
|
||||
VideoDecoder::Drain()
|
||||
{
|
||||
if (!mDecoder) {
|
||||
if (mCallback) {
|
||||
mCallback->DrainComplete();
|
||||
}
|
||||
return;
|
||||
}
|
||||
EnsureWorker();
|
||||
mWorkerThread->Post(WrapTask(this,
|
||||
&VideoDecoder::DrainTask));
|
||||
|
Loading…
Reference in New Issue
Block a user