From 31fc2f51353582e48b6e3cd8c13bc6f7e4e0e834 Mon Sep 17 00:00:00 2001 From: Denis Akhmetzyanov Date: Fri, 14 Sep 2018 00:04:11 +0300 Subject: [PATCH] Clear up condition in AesPatternCryptor (#476) The condition was the same in meaning, but a bit confusing in syntax. --- packager/media/base/aes_pattern_cryptor.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packager/media/base/aes_pattern_cryptor.cc b/packager/media/base/aes_pattern_cryptor.cc index b3216069a6..bc2a11a21a 100644 --- a/packager/media/base/aes_pattern_cryptor.cc +++ b/packager/media/base/aes_pattern_cryptor.cc @@ -54,9 +54,8 @@ bool AesPatternCryptor::CryptInternal(const uint8_t* text, if (text_size <= crypt_byte_size) { const bool need_encrypt = - encryption_mode_ == kSkipIfCryptByteBlockRemaining - ? (text_size > crypt_byte_size) - : (text_size >= AES_BLOCK_SIZE); + encryption_mode_ != kSkipIfCryptByteBlockRemaining && + text_size >= AES_BLOCK_SIZE; if (need_encrypt) { // The partial pattern SHALL be followed with the partial 16-byte block // remains unencrypted.