Fix MSVC warning C4267: conversion from 'size_t' to 'long'

This commit is contained in:
Luis Díaz Más
2018-04-08 12:13:26 +02:00
parent 794fea2639
commit ffbcaa2e6d
+6 -6
View File
@@ -268,12 +268,12 @@ namespace Exiv2
#endif
const long pad = 3 ; // 3 padding bytes 2 0 0
const size_t data_length = Safe::add(subBox.length, static_cast<uint32_t>(8));
// data_length makes no sense if it is larger than the rest of the file
if (data_length > io_->size() - io_->tell()) {
throw Error(kerCorruptedMetadata);
}
DataBuf data(data_length);
const size_t data_length = Safe::add(subBox.length, static_cast<uint32_t>(8));
// data_length makes no sense if it is larger than the rest of the file
if (data_length > io_->size() - io_->tell()) {
throw Error(kerCorruptedMetadata);
}
DataBuf data(static_cast<long>(data_length));
io_->read(data.pData_,data.size_);
const long iccLength = getULong(data.pData_+pad, bigEndian);
// subtracting pad from data.size_ is safe: