Bug 1269048: Prevent null deref in debugging information. r?jwwang draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 02 May 2016 08:49:18 +1000
changeset 358137 73ce27176ef4948d2306c56e9451ba0106ba6114
parent 358136 31b1211e1ef4e2ede94187a209e0e1e37ec98a01
child 519795 224dc1cc3d4310f4adb813d0c932d3bf0176a46e
push id16947
push userbmo:jyavenard@mozilla.com
push dateSun, 01 May 2016 22:49:57 +0000
reviewersjwwang
bugs1269048
milestone49.0a1
Bug 1269048: Prevent null deref in debugging information. r?jwwang MozReview-Commit-ID: FKq9dtrdegg
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1876,17 +1876,18 @@ MediaDecoder::NextFrameBufferedStatus()
     : MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
 }
 
 void
 MediaDecoder::DumpDebugInfo()
 {
   DUMP_LOG("metadata: channels=%u rate=%u hasAudio=%d hasVideo=%d, "
            "state: mPlayState=%s mIsDormant=%d, mShuttingDown=%d",
-           mInfo->mAudio.mChannels, mInfo->mAudio.mRate, mInfo->HasAudio(), mInfo->HasVideo(),
+           mInfo ? mInfo->mAudio.mChannels : 0, mInfo ? mInfo->mAudio.mRate : 0,
+           mInfo ? mInfo->HasAudio() : 0, mInfo ? mInfo->HasVideo() : 0,
            PlayStateStr(), mIsDormant, mShuttingDown);
 
   nsString str;
   GetMozDebugReaderData(str);
   DUMP_LOG("reader data:\n%s", NS_ConvertUTF16toUTF8(str).get());
 
   if (!mShuttingDown && GetStateMachine()) {
     GetStateMachine()->DumpDebugInfo();