Don't add offsets to ion handles
Fixes a secure buffer addressing offset error in the Widevine CENC drm engine. bug: 8667527 Merges the following from Widevine CDM repository: Allow specification of offset into secure buffer https://widevine-internal-review.googlesource.com/#/c/5100/ Update WVCryptoPlugin to Pass Output Offset as a Separate Parameter https://widevine-internal-review.googlesource.com/#/c/5120/ Add offset to secure data buffer in OEMCrypto DecryptCTR https://widevine-internal-review.googlesource.com/#/c/5110/ Change-Id: Ic3e4b35304c8fbae4aebe4c495285eb787e8c205
This commit is contained in:
@@ -392,6 +392,7 @@ CdmResponseType CryptoSession::Decrypt(bool is_encrypted,
|
||||
const std::vector<uint8_t>& iv,
|
||||
size_t block_offset,
|
||||
void* decrypt_buffer,
|
||||
size_t decrypt_buffer_offset,
|
||||
bool is_video) {
|
||||
if (!is_destination_buffer_type_valid_) {
|
||||
if (!SetDestinationBufferType())
|
||||
@@ -404,11 +405,12 @@ CdmResponseType CryptoSession::Decrypt(bool is_encrypted,
|
||||
switch (buffer_descriptor.type) {
|
||||
case OEMCrypto_BufferType_Clear:
|
||||
buffer_descriptor.buffer.clear.address =
|
||||
static_cast<uint8_t*>(decrypt_buffer);
|
||||
static_cast<uint8_t*>(decrypt_buffer) + decrypt_buffer_offset;
|
||||
buffer_descriptor.buffer.clear.max_length = encrypt_length;
|
||||
break;
|
||||
case OEMCrypto_BufferType_Secure:
|
||||
buffer_descriptor.buffer.secure.handle = decrypt_buffer;
|
||||
buffer_descriptor.buffer.secure.offset = decrypt_buffer_offset;
|
||||
buffer_descriptor.buffer.secure.max_length = encrypt_length;
|
||||
break;
|
||||
case OEMCrypto_BufferType_Direct:
|
||||
|
||||
Reference in New Issue
Block a user