am e5d4a0be: DO NOT MERGE Part of fix for libmedia OOB write anywhere
* commit 'e5d4a0be30bac8fdba7194841084dcf61be6e8a2': DO NOT MERGE Part of fix for libmedia OOB write anywhere
This commit is contained in:
@@ -40,6 +40,7 @@ enum CdmResponseType {
|
|||||||
NEED_PROVISIONING,
|
NEED_PROVISIONING,
|
||||||
DEVICE_REVOKED,
|
DEVICE_REVOKED,
|
||||||
INSUFFICIENT_CRYPTO_RESOURCES,
|
INSUFFICIENT_CRYPTO_RESOURCES,
|
||||||
|
SECURE_BUFFER_REQUIRED,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CORE_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
#define CORE_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||||
|
|||||||
@@ -647,6 +647,10 @@ CdmResponseType CryptoSession::Decrypt(const CdmDecryptionParameters& params) {
|
|||||||
buffer_descriptor.type =
|
buffer_descriptor.type =
|
||||||
params.is_secure ? destination_buffer_type_ : OEMCrypto_BufferType_Clear;
|
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) {
|
switch (buffer_descriptor.type) {
|
||||||
case OEMCrypto_BufferType_Clear:
|
case OEMCrypto_BufferType_Clear:
|
||||||
buffer_descriptor.buffer.clear.address =
|
buffer_descriptor.buffer.clear.address =
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
return kErrorCDMGeneric;
|
return kErrorCDMGeneric;
|
||||||
case wvcdm::UNKNOWN_ERROR:
|
case wvcdm::UNKNOWN_ERROR:
|
||||||
return android::ERROR_DRM_UNKNOWN;
|
return android::ERROR_DRM_UNKNOWN;
|
||||||
|
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
|
// Return here instead of as a default case so that the compiler will warn
|
||||||
|
|||||||
Reference in New Issue
Block a user