klocwork: fix risk issues

This commit is contained in:
Hong, Yang A
2022-05-31 06:30:18 +00:00
committed by Konstantinos Margaritis
parent 88a1048ae7
commit 2d521d64a2
15 changed files with 61 additions and 10 deletions

View File

@@ -124,6 +124,10 @@ RepeatStateInfo::RepeatStateInfo(enum RepeatType type, const depth &repeatMin,
const depth &repeatMax, u32 minPeriod)
: stateSize(0), packedCtrlSize(0), horizon(0), patchCount(0),
patchSize(0), encodingSize(0), patchesOffset(0) {
if (type == REPEAT_SPARSE_OPTIMAL_P && minPeriod == 0) {
assert(0);
throw std::domain_error("SPARSE_OPTIMAL_P must have non-zero minPeriod.");
}
assert(repeatMin <= repeatMax);
assert(repeatMax.is_reachable());
assert(minPeriod || type != REPEAT_SPARSE_OPTIMAL_P);