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 331417 37ae3a4b4185ff3b9cb0066cddf5500fdd976081
parent 331416 c6f69694a1f9b35c59ca33d6cc2ba430f39dcdf6
child 331418 cd04bd37115c1eaba4fc53cf3cd62dd3167565f3
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [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