Closed Bug 836143 Opened 9 years ago Closed 9 years ago
Decoder should call its own On Decode Thread for clearer error detection
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+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.