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 295639 a34db9cb5280a8ce261477dc850142e4feffcda0
parent 295638 74bb0630a775f51a23f913c4fc5c1c6985f08599
child 295640 bfd20783b793364e62e6dcd599ad7c6746a8224e
push id76026
push userjyavenard@mozilla.com
push dateMon, 02 May 2016 01:40:48 +0000
treeherdermozilla-inbound@a34db9cb5280 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1269048
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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();