added casts to prevent unitended overflows

This commit is contained in:
Eharve14 2022-01-18 15:13:25 -05:00
parent 122093bef4
commit 31445c5ed9
1 changed files with 1 additions and 1 deletions

View File

@ -457,7 +457,7 @@ void opj_calculate_norms(OPJ_FLOAT64 * pNorms,
for (j = 0; j < pNbComps; ++j) {
lCurrentValue = lMatrix[lIndex];
lIndex += pNbComps;
lNorms[i] += lCurrentValue * lCurrentValue;
lNorms[i] += (OPJ_FLOAT64) lCurrentValue * lCurrentValue;
}
lNorms[i] = sqrt(lNorms[i]);
}