Bug 1264991: Don't construct invalid channel configuration. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sat, 16 Apr 2016 14:35:32 +1000
changeset 293546 37ae3a4b4185ff3b9cb0066cddf5500fdd976081
parent 293545 c6f69694a1f9b35c59ca33d6cc2ba430f39dcdf6
child 293547 cd04bd37115c1eaba4fc53cf3cd62dd3167565f3
push id30186
push usercbook@mozilla.com
push dateMon, 18 Apr 2016 12:40:25 +0000
treeherdermozilla-central@6066850740cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1264991
milestone48.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 1264991: Don't construct invalid channel configuration. r=gerald MozReview-Commit-ID: JTZJdCD94gH
dom/media/MediaInfo.h
--- a/dom/media/MediaInfo.h
+++ b/dom/media/MediaInfo.h
@@ -499,16 +499,20 @@ public:
       : mChannelMap(0)
       , mValid(false)
     {}
     explicit ChannelLayout(uint32_t aChannels)
       : ChannelLayout(aChannels, SMPTEDefault(aChannels))
     {}
     ChannelLayout(uint32_t aChannels, const Channel* aConfig)
     {
+      if (!aConfig) {
+        mValid = false;
+        return;
+      }
       mChannels.AppendElements(aConfig, aChannels);
       UpdateChannelMap();
     }
     bool operator==(const ChannelLayout& aOther) const
     {
       return mChannels == aOther.mChannels;
     }
     bool operator!=(const ChannelLayout& aOther) const