Commit 90e0914b authored by xhwang@chromium.org's avatar xhwang@chromium.org

KeySystems: IsSupportedContainerAndCodecs() ignores empty codec.

In IsTypeSupported() call, when the codec string in the mime type contains extra
commas, e.g. ",vorbis", an empty codec will be passed into
IsSupportedContainerAndCodecs. In this case, we should ignore that codec instead
of assuming it's not empty.

BUG=362769
TEST=Layout test crash is fixed.
R=ddorwin@chromium.org

Review URL: https://codereview.chromium.org/254913002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266335 0039d316-1c4b-4281-b951-d872f2087c98
parent 2f68b644
...@@ -281,7 +281,8 @@ bool KeySystems::IsSupportedContainerAndCodecs( ...@@ -281,7 +281,8 @@ bool KeySystems::IsSupportedContainerAndCodecs(
for (size_t i = 0; i < codecs.size(); ++i) { for (size_t i = 0; i < codecs.size(); ++i) {
const std::string& codec = codecs[i]; const std::string& codec = codecs[i];
DCHECK(!codec.empty()); if (codec.empty())
continue;
CodecMaskMap::const_iterator codec_iter = codec_masks_.find(codec); CodecMaskMap::const_iterator codec_iter = codec_masks_.find(codec);
if (codec_iter == codec_masks_.end()) // Unrecognized codec. if (codec_iter == codec_masks_.end()) // Unrecognized codec.
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment