Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: media/blink/webencryptedmediaclient_impl.cc

Issue 1035923004: Check that containers are supported by Chrome in requestMediaKeySystemAccess(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webencryptedmediaclient_impl.cc
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc
index ccd44fb528f562d24de1e35b02f771f25eacef0b..7b3374974fb4ab0dae61d25908c8aa5a43bc9552 100644
--- a/media/blink/webencryptedmediaclient_impl.cc
+++ b/media/blink/webencryptedmediaclient_impl.cc
@@ -146,13 +146,19 @@ static bool IsSupportedContentType(
return false;
}
- if (codec_vector.empty())
- return true;
+ // Check that |container_mime_type| is supported by Chrome. This can only
+ // happen if the CDM declares support for a container that Chrome does not.
+ if (!net::IsSupportedMediaMimeType(container_lower)) {
+ NOTREACHED();
+ return false;
+ }
// Check that |codecs| are supported by Chrome. This is done primarily to
// validate extended codecs, but it also ensures that the CDM cannot support
// codecs that Chrome does not (which could complicate the robustness
// algorithm).
+ if (codec_vector.empty())
+ return true;
codec_vector.clear();
net::ParseCodecString(codecs, &codec_vector, false);
return (net::IsSupportedStrictMediaMimeType(container_lower, codec_vector) ==
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698