Skip to content

Commit

Permalink
Proposed fix for shaka-project#1316
Browse files Browse the repository at this point in the history
  • Loading branch information
synologic committed Dec 13, 2023
1 parent 3e71302 commit 92c2b42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packager/media/base/aes_encryptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ bool AesCbcEncryptor::CryptInternal(const uint8_t* plaintext,
const size_t num_padding_bytes = NumPaddingBytes(plaintext_size);
const size_t required_ciphertext_size = RequiredOutputSize(plaintext_size);

if (*ciphertext_size < required_ciphertext_size) {
// RequiredOutputSize returns the plaintext_size plus AES_BLOCK_SIZE as required by mbedtls, subtract that here
if (*ciphertext_size < required_ciphertext_size - AES_BLOCK_SIZE) {
LOG(ERROR) << "Expecting output size of at least "
<< required_ciphertext_size << " bytes.";
return false;
Expand Down

0 comments on commit 92c2b42

Please sign in to comment.