Bug 1626787 - ClearKeyDecryptionManager.cpp check emptiness by empty instead of by size. r=sylvestre

Emptiness of values should be checked using the `empty` method, and not
by comparing the size to 0. Fix such case in the code of
ClearKeyDecryptionManager.cpp module.

Differential Revision: https://phabricator.services.mozilla.com/D70206

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Omri Sarig 2020-04-08 15:47:17 +00:00
Родитель 2fdf5b0a0a
Коммит a60ad3ae44
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -258,7 +258,7 @@ Status ClearKeyDecryptor::Decrypt(uint8_t* aBuffer, uint32_t aBufferSize,
// encrypted sample lengths are zero, and in this case, a zero length
// IV is allowed.
assert(aMetadata.mIV.size() == 8 || aMetadata.mIV.size() == 16 ||
(aMetadata.mIV.size() == 0 && AllZero(aMetadata.mCipherBytes)));
(aMetadata.mIV.empty() && AllZero(aMetadata.mCipherBytes)));
std::vector<uint8_t> iv(aMetadata.mIV);
iv.insert(iv.end(), CENC_KEY_LEN - aMetadata.mIV.size(), 0);