mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1097823 - Followup to avoid null-derefing when promises have already been rejected during shutdown. rpending=cpearce
This commit is contained in:
parent
b007d59daf
commit
eab5796fe5
@ -315,6 +315,9 @@ private:
|
||||
bool mAudioDiscontinuity;
|
||||
bool mVideoDiscontinuity;
|
||||
bool mShutdown;
|
||||
|
||||
public:
|
||||
bool IsShutdown() { return mShutdown; }
|
||||
};
|
||||
|
||||
// Interface that callers to MediaDecoderReader::Request{Audio,Video}Data()
|
||||
|
@ -170,7 +170,11 @@ MediaSourceReader::OnAudioNotDecoded(NotDecodedReason aReason)
|
||||
{
|
||||
MSE_DEBUG("MediaSourceReader(%p)::OnAudioNotDecoded aReason=%u IsEnded: %d", this, aReason, IsEnded());
|
||||
if (aReason == DECODE_ERROR || aReason == CANCELED) {
|
||||
mAudioPromise.Reject(aReason, __func__);
|
||||
if (!mAudioPromise.IsEmpty()) {
|
||||
mAudioPromise.Reject(aReason, __func__);
|
||||
} else {
|
||||
MOZ_ASSERT(IsShutdown(), "This only happens when shutdown clears the promise");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -260,7 +264,11 @@ MediaSourceReader::OnVideoNotDecoded(NotDecodedReason aReason)
|
||||
{
|
||||
MSE_DEBUG("MediaSourceReader(%p)::OnVideoNotDecoded aReason=%u IsEnded: %d", this, aReason, IsEnded());
|
||||
if (aReason == DECODE_ERROR || aReason == CANCELED) {
|
||||
mVideoPromise.Reject(aReason, __func__);
|
||||
if (!mVideoPromise.IsEmpty()) {
|
||||
mVideoPromise.Reject(aReason, __func__);
|
||||
} else {
|
||||
MOZ_ASSERT(IsShutdown(), "This only happens when shutdown clears the promise");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user