MediaDecoder should call its own OnDecodeThread for clearer error detection

RESOLVED FIXED in mozilla21

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: sworkman, Assigned: sworkman)

Tracking

unspecified
mozilla21
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I had an intermittent crash on try (unreproducible locally), in which mDecoderStateMachine was null in MediaDecoder::NotifyBytesConsumed. Specifically, there was an nsCOMPtr crash due to a null mDecoderStateMachine in the MOZ_ASSERT which calls mDecoderStateMachine->OnDecodeThread. The stack trace and error message could have been clearer.

Since I can't reproduce it locally, I'd like to change the error checks to be a little more explicit next time.
-- MOZ_ASSERT should call MediaDecoder::OnDecodeThread, which has a null check for mDecoderStateMachine right before the call.
-- Add an NS_WARN_IF_FALSE to OnDecodeThread to clearly state when mDecoderStateMachine is null.

This way, a crash caused by null mDecoderStateMachine will be caught as such, and not via a null nsCOMPtr crash. Note: The rest of the functions in MediaDecoder call MediaDecoder::OnDecodeThread, not mDecoderStateMachine::OnDecodeThread.
Attachment #707922 - Flags: review?(cpearce) → review+
https://hg.mozilla.org/mozilla-central/rev/47354ad87a98
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.