Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 38c77e8

Browse files
committed
Bug 1406080 - Part2 - Reject creating with unsupported cdm version in clearkey cdm and cdm-fake. r=cpearce
MozReview-Commit-ID: JvSsqZekRQ6 --HG-- extra : rebase_source : e80713dbf52aad29a32ff71a083c19479094b9a6
1 parent a18e6f1 commit 38c77e8

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

dom/media/fake-cdm/cdm-fake.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ void* CreateCdmInstance(int cdm_interface_version,
5252
GetCdmHostFunc get_cdm_host_func,
5353
void* user_data)
5454
{
55+
if (cdm_interface_version != cdm::ContentDecryptionModule_8::kVersion) {
56+
// Only support CDM version 8 currently.
57+
return nullptr;
58+
}
5559
cdm::Host_8* host = static_cast<cdm::Host_8*>(
5660
get_cdm_host_func(cdm_interface_version, user_data));
5761
return new FakeDecryptor(host);

media/gmp-clearkey/0.1/gmp-clearkey.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ void* CreateCdmInstance(int cdm_interface_version,
5656

5757
CK_LOGE("ClearKey CreateCDMInstance");
5858

59+
if (cdm_interface_version != cdm::ContentDecryptionModule_8::kVersion) {
60+
CK_LOGE("ClearKey CreateCDMInstance failed due to requesting unsupported version %d.",
61+
cdm_interface_version);
62+
return nullptr;
63+
}
5964
#ifdef ENABLE_WMF
6065
if (!wmf::EnsureLibs()) {
6166
CK_LOGE("Required libraries were not found");

0 commit comments

Comments
 (0)