Index: content/browser/media/cdm/browser_cdm_manager.cc |
diff --git a/content/browser/media/cdm/browser_cdm_manager.cc b/content/browser/media/cdm/browser_cdm_manager.cc |
index 8f1e78ae84324ea41406913c2d156bda8fa0774b..bf5e6f58d9f79edf33c7a47921102fdee169da34 100644 |
--- a/content/browser/media/cdm/browser_cdm_manager.cc |
+++ b/content/browser/media/cdm/browser_cdm_manager.cc |
@@ -36,6 +36,11 @@ using media::MediaKeys; |
namespace { |
+#if defined(OS_ANDROID) |
+// Android only supports 128-bit key IDs. |
+const size_t kMaxKeyIdLength = 128 / 8; |
ddorwin
2015/04/29 21:19:56
We could always have a limit (i.e. 1024 or whateve
jrummell
2015/05/15 00:52:59
Renamed. The existing global limit is not currentl
|
+#endif |
+ |
// The ID used in this class is a concatenation of |render_frame_id| and |
// |cdm_id|, i.e. (render_frame_id << 32) + cdm_id. |
@@ -344,6 +349,14 @@ void BrowserCdmManager::OnCreateSessionAndGenerateRequest( |
promise->reject(MediaKeys::INVALID_ACCESS_ERROR, 0, "Init data too long."); |
return; |
} |
+#if defined(OS_ANDROID) |
+ if (init_data_type == INIT_DATA_TYPE_WEBM && |
+ init_data.size() > kMaxKeyIdLength) { |
+ promise->reject(MediaKeys::INVALID_ACCESS_ERROR, 0, |
+ "Init data for WEBM too long."); |
ddorwin
2015/04/29 21:19:56
"'webm' initData is too long."
jrummell
2015/05/15 00:52:59
Done.
|
+ return; |
+ } |
+#endif |
media::EmeInitDataType eme_init_data_type; |
switch (init_data_type) { |