pixelshift: Fixed a crash caused by division by zero when Show motion was enabled

This commit is contained in:
heckflosse
2016-11-27 20:07:02 +01:00
parent b9fb8cf292
commit 13bd6752f6

View File

@@ -51,7 +51,7 @@ float colourDiff(float a, float b, bool adaptive, float stddevFactor, float eper
if(!showMotion) {
return result;
} else if(result > 0.f) { // for the motion mask
return std::fabs(a - b) / std::max(a, b) + 0.01f;
return std::fabs(a - b) / (std::max(a, b) + 0.01f);
} else {
return 0.f;
}