Bug 1266336 - Check sCDMWrapper before creating video decoder - r=cpearce

Ensure that there is a CDM before creating a video decoder that relies on that
CDM. This is mainly to prevent using the Widevine video decoder alone, without
decryption.

MozReview-Commit-ID: 7p49CnmV2r7

--HG--
extra : rebase_source : 49b07100b2be56584bc14f41d39d4872f0539c3a
This commit is contained in:
Gerald Squelart 2016-05-05 11:37:22 +10:00
Родитель faee3cba4f
Коммит 7a14964bfb
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -124,7 +124,13 @@ WidevineAdapter::GMPGetAPI(const char* aAPIName,
*aPluginAPI = decryptor;
} else if (!strcmp(aAPIName, GMP_API_VIDEO_DECODER)) {
*aPluginAPI = new WidevineVideoDecoder(static_cast<GMPVideoHost*>(aHostAPI), RefPtr<CDMWrapper>(sCDMWrapper));
if (!sCDMWrapper) {
Log("WidevineAdapter::GMPGetAPI(%s, 0x%p, 0x%p) this=0x%p No cdm for video decoder",
aAPIName, aHostAPI, aPluginAPI, this);
return GMPGenericErr;
}
*aPluginAPI = new WidevineVideoDecoder(static_cast<GMPVideoHost*>(aHostAPI),
RefPtr<CDMWrapper>(sCDMWrapper));
}
return *aPluginAPI ? GMPNoErr : GMPNotImplementedErr;