mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 688516 - Null check mElement before use in NotifyDownloadEnded and AudioAvailable. r=cpearce
This commit is contained in:
parent
ba7be2f99c
commit
8579719cfc
@ -402,7 +402,7 @@ void nsBuiltinDecoder::AudioAvailable(float* aFrameBuffer,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mElement->MayHaveAudioAvailableEventListener()) {
|
||||
if (!mElement || !mElement->MayHaveAudioAvailableEventListener()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -442,8 +442,7 @@ void nsBuiltinDecoder::MetadataLoaded(PRUint32 aChannels,
|
||||
|
||||
if (!mResourceLoaded) {
|
||||
StartProgress();
|
||||
}
|
||||
else if (mElement) {
|
||||
} else if (mElement) {
|
||||
// Resource was loaded during metadata loading, when progress
|
||||
// events are being ignored. Fire the final progress event.
|
||||
mElement->DispatchAsyncEvent(NS_LITERAL_STRING("progress"));
|
||||
@ -664,7 +663,9 @@ void nsBuiltinDecoder::NotifyDownloadEnded(nsresult aStatus)
|
||||
|
||||
if (aStatus == NS_BINDING_ABORTED) {
|
||||
// Download has been cancelled by user.
|
||||
mElement->LoadAborted();
|
||||
if (mElement) {
|
||||
mElement->LoadAborted();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ static const PRUint32 STALL_MS = 3000;
|
||||
static const PRInt64 CAN_PLAY_THROUGH_MARGIN = 10;
|
||||
|
||||
nsMediaDecoder::nsMediaDecoder() :
|
||||
mElement(0),
|
||||
mElement(nsnull),
|
||||
mRGBWidth(-1),
|
||||
mRGBHeight(-1),
|
||||
mVideoUpdateLock("nsMediaDecoder.mVideoUpdateLock"),
|
||||
|
Loading…
Reference in New Issue
Block a user