Fix some coverity and cppcheck issues

This commit is contained in:
heckflosse
2017-06-18 18:40:40 +02:00
parent ae67344f16
commit 8aff354df9
14 changed files with 30 additions and 27 deletions

View File

@@ -545,6 +545,7 @@ void CropHandler::colorPick (const rtengine::Coord &pickerPos, float &r, float &
}
}
count = std::max(1u, count);
// Averaging
r = (float)r2 / (float)count / 255.f;
g = (float)g2 / (float)count / 255.f;
@@ -569,6 +570,8 @@ void CropHandler::colorPick (const rtengine::Coord &pickerPos, float &r, float &
}
}
}
count = std::max(1u, count);
// Averaging
rpreview = (float)r2 / (float)count / 255.f;
gpreview = (float)g2 / (float)count / 255.f;