am d38fc184: am 1319c433: Part of fix for libmedia OOB write anywhere

* commit 'd38fc184a7dc544d064d8086f5e72092debaa413':
  Part of fix for libmedia OOB write anywhere
This commit is contained in:
Jeff Tinker
2015-08-19 23:18:19 +00:00
committed by Android Git Automerger
3 changed files with 7 additions and 0 deletions

View File

@@ -202,6 +202,7 @@ enum CdmResponseType {
LICENSE_REQUEST_NONCE_GENERATION_ERROR,
LICENSE_REQUEST_SIGNING_ERROR,
EMPTY_LICENSE_REQUEST,
SECURE_BUFFER_REQUIRED,
};
enum CdmKeyStatus {

View File

@@ -641,6 +641,10 @@ CdmResponseType CryptoSession::Decrypt(const CdmDecryptionParameters& params) {
buffer_descriptor.type =
params.is_secure ? destination_buffer_type_ : OEMCrypto_BufferType_Clear;
if (params.is_secure && buffer_descriptor.type == OEMCrypto_BufferType_Clear) {
return SECURE_BUFFER_REQUIRED;
}
switch (buffer_descriptor.type) {
case OEMCrypto_BufferType_Clear:
buffer_descriptor.buffer.clear.address =

View File

@@ -345,6 +345,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return android::ERROR_DRM_UNKNOWN;
case wvcdm::UNUSED_1:
return android::UNKNOWN_ERROR;
case wvcdm::SECURE_BUFFER_REQUIRED:
return android::ERROR_DRM_CANNOT_HANDLE;
}
// Return here instead of as a default case so that the compiler will warn