Division by zero in Raw Whitepoint Correction, reported by cppcheck, no Issue
This commit is contained in:
@@ -113,7 +113,7 @@ void RawImageSource::processRawWhitepoint(float expos, float preser) {
|
|||||||
if(expos>1){
|
if(expos>1){
|
||||||
// Positive exposure
|
// Positive exposure
|
||||||
K = (float) maxVal / expos*exp(-preser*log(2.0));
|
K = (float) maxVal / expos*exp(-preser*log(2.0));
|
||||||
for (int j=0;j<=maxVal;j++)
|
for (int j=max(1,(int)K);j<=maxVal;j++)
|
||||||
lut[(int)j]=(((float)maxVal-K*expos)/((float)maxVal-K)*(j-maxVal)+(float) maxVal) / j;
|
lut[(int)j]=(((float)maxVal-K*expos)/((float)maxVal-K)*(j-maxVal)+(float) maxVal) / j;
|
||||||
} else {
|
} else {
|
||||||
// Negative exposure
|
// Negative exposure
|
||||||
|
Reference in New Issue
Block a user