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()
|
AudioDecoder::~AudioDecoder()
|
||||||
{
|
{
|
||||||
mMutex->Destroy();
|
if (mMutex) {
|
||||||
|
mMutex->Destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -223,8 +225,12 @@ AudioDecoder::MFToGMPSample(IMFSample* aInput,
|
|||||||
void
|
void
|
||||||
AudioDecoder::Reset()
|
AudioDecoder::Reset()
|
||||||
{
|
{
|
||||||
mDecoder->Reset();
|
if (mDecoder) {
|
||||||
mCallback->ResetComplete();
|
mDecoder->Reset();
|
||||||
|
}
|
||||||
|
if (mCallback) {
|
||||||
|
mCallback->ResetComplete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -248,6 +254,9 @@ AudioDecoder::DrainTask()
|
|||||||
void
|
void
|
||||||
AudioDecoder::Drain()
|
AudioDecoder::Drain()
|
||||||
{
|
{
|
||||||
|
if (!mDecoder) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
EnsureWorker();
|
EnsureWorker();
|
||||||
mWorkerThread->Post(WrapTask(this,
|
mWorkerThread->Post(WrapTask(this,
|
||||||
&AudioDecoder::DrainTask));
|
&AudioDecoder::DrainTask));
|
||||||
|
@ -39,7 +39,9 @@ VideoDecoder::VideoDecoder(GMPVideoHost *aHostAPI)
|
|||||||
|
|
||||||
VideoDecoder::~VideoDecoder()
|
VideoDecoder::~VideoDecoder()
|
||||||
{
|
{
|
||||||
mMutex->Destroy();
|
if (mMutex) {
|
||||||
|
mMutex->Destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -330,8 +332,12 @@ VideoDecoder::SampleToVideoFrame(IMFSample* aSample,
|
|||||||
void
|
void
|
||||||
VideoDecoder::Reset()
|
VideoDecoder::Reset()
|
||||||
{
|
{
|
||||||
mDecoder->Reset();
|
if (mDecoder) {
|
||||||
mCallback->ResetComplete();
|
mDecoder->Reset();
|
||||||
|
}
|
||||||
|
if (mCallback) {
|
||||||
|
mCallback->ResetComplete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -361,6 +367,12 @@ VideoDecoder::DrainTask()
|
|||||||
void
|
void
|
||||||
VideoDecoder::Drain()
|
VideoDecoder::Drain()
|
||||||
{
|
{
|
||||||
|
if (!mDecoder) {
|
||||||
|
if (mCallback) {
|
||||||
|
mCallback->DrainComplete();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
EnsureWorker();
|
EnsureWorker();
|
||||||
mWorkerThread->Post(WrapTask(this,
|
mWorkerThread->Post(WrapTask(this,
|
||||||
&VideoDecoder::DrainTask));
|
&VideoDecoder::DrainTask));
|
||||||
|
Loading…
Reference in New Issue
Block a user