Bug 1269048: Prevent null deref in debugging information. r=jwwang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 02 May 2016 08:49:18 +1000
changeset 295693 a34db9cb5280a8ce261477dc850142e4feffcda0
parent 295692 74bb0630a775f51a23f913c4fc5c1c6985f08599
child 295694 bfd20783b793364e62e6dcd599ad7c6746a8224e
push id19015
push usercbook@mozilla.com
push dateMon, 02 May 2016 09:39:23 +0000
treeherderfx-team@2080375bc69d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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();