Replace assert with enforce. (Fix for https://github.com/Exiv2/exiv2/issues/2268)

This commit is contained in:
Kevin Backhouse 2022-07-06 13:23:24 +01:00
parent 6b5453c9d5
commit 0c3da129f2
No known key found for this signature in database
GPG Key ID: 9DD01852EE40366E

View File

@ -475,7 +475,7 @@ void Jp2Image::printStructure(std::ostream& out, PrintStructureOption option, in
}
if (subBox.type == kJp2BoxTypeImageHeader) {
assert(subBox.length == 22);
enforce(subBox.length == 22, ErrorCode::kerCorruptedMetadata);
// height (4), width (4), componentsCount (2), bpc (1)
auto compressionType = data.read_uint8(11);
auto unkC = data.read_uint8(12);