Fix break in Windows (#213)

This commit is contained in:
Kongqun Yang 2017-03-22 09:57:18 -07:00 committed by GitHub
parent b09c8f6521
commit d323d4f091
2 changed files with 11 additions and 7 deletions

View File

@ -383,7 +383,7 @@ bool EncryptionHandler::CreateEncryptor(const EncryptionKey& encryption_key) {
encryption_config_->per_sample_iv_size = 0; encryption_config_->per_sample_iv_size = 0;
encryption_config_->constant_iv = iv; encryption_config_->constant_iv = iv;
} else { } else {
encryption_config_->per_sample_iv_size = iv.size(); encryption_config_->per_sample_iv_size = static_cast<uint8_t>(iv.size());
} }
encryption_config_->key_id = encryption_key.key_id; encryption_config_->key_id = encryption_key.key_id;
encryption_config_->key_system_info = encryption_key.key_system_info; encryption_config_->key_system_info = encryption_key.key_system_info;

View File

@ -228,19 +228,23 @@ class EncryptionHandlerEncryptionTest
if (codec_ == kCodecAAC) if (codec_ == kCodecAAC)
return subsamples; return subsamples;
if (protection_scheme_ == kAppleSampleAesProtectionScheme) { if (protection_scheme_ == kAppleSampleAesProtectionScheme) {
subsamples.emplace_back(kSampleAesClearSize1, kSampleAesCipherSize1); subsamples.emplace_back(static_cast<uint16_t>(kSampleAesClearSize1),
subsamples.emplace_back(kSubsampleSize3, 0u); static_cast<uint32_t>(kSampleAesCipherSize1));
subsamples.emplace_back(static_cast<uint16_t>(kSubsampleSize3), 0u);
} else { } else {
if (codec_ == kCodecVP9 || protection_scheme_ == FOURCC_cbc1 || if (codec_ == kCodecVP9 || protection_scheme_ == FOURCC_cbc1 ||
protection_scheme_ == FOURCC_cens) { protection_scheme_ == FOURCC_cens) {
// Align the encrypted bytes to multiple of 16 bytes. // Align the encrypted bytes to multiple of 16 bytes.
subsamples.emplace_back(kAlignedClearSize1, kAlignedCipherSize1); subsamples.emplace_back(static_cast<uint16_t>(kAlignedClearSize1),
static_cast<uint32_t>(kAlignedCipherSize1));
// Subsample 2 is already aligned. // Subsample 2 is already aligned.
} else { } else {
subsamples.emplace_back(kClearSize1, kCipherSize1); subsamples.emplace_back(static_cast<uint16_t>(kClearSize1),
static_cast<uint32_t>(kCipherSize1));
} }
subsamples.emplace_back(kClearSize2, kCipherSize2); subsamples.emplace_back(static_cast<uint16_t>(kClearSize2),
subsamples.emplace_back(kSubsampleSize3, 0u); static_cast<uint32_t>(kCipherSize2));
subsamples.emplace_back(static_cast<uint16_t>(kSubsampleSize3), 0u);
} }
return subsamples; return subsamples;
} }