CryptoSession: handle 0-length buffer in DecryptSample
In `Combine Decrypt Calls to OEMCrypto`, OEMCrypto_ERROR_BUFFER_TOO_LARGE is used as the default error code to signal fallback to legacy decrypt (sending subsamples separately). The error code would not be updated if no calls to OEMCrypto were made (e.g. 0-length buffers). This change resets error code to OEMCrypto_SUCCESS after fall back to legacy decrypt. Consequently, buffers that do no require OEMCrypto calls would return OEMCrypto_SUCCESS. Merge of http://go/wvgerrit/96743 Bug: 150188155 Test: GtsMediaTestCases Test: DashTest#testWidevineH264AdaptiveWithRendererDisabling Change-Id: Ib23803c51f16bc809bda5c2720e628e81f1df1dc
This commit is contained in:
@@ -2692,6 +2692,7 @@ OEMCryptoResult CryptoSession::DecryptSample(
|
||||
|
||||
if (sts == OEMCrypto_ERROR_BUFFER_TOO_LARGE) {
|
||||
// Fall back to sending each subsample region individually
|
||||
sts = OEMCrypto_SUCCESS;
|
||||
OEMCrypto_SampleDescription fake_sample = sample;
|
||||
for (size_t i = 0; i < sample.subsamples_length; ++i) {
|
||||
const OEMCrypto_SubSampleDescription& original_subsample =
|
||||
|
||||
Reference in New Issue
Block a user