Guard for divide by zero
This commit is contained in:
parent
a5f02c3a75
commit
a35fb23349
@ -285,7 +285,11 @@ namespace
|
||||
pSrcRow0 = pSrcRow1;
|
||||
}
|
||||
|
||||
coverage = static_cast<float>(coverageCount) / static_cast<float>((srcImage.width - 1) * (srcImage.height - 1) * N * N);
|
||||
float cscale = static_cast<float>((srcImage.width - 1) * (srcImage.height - 1) * N * N);
|
||||
if (cscale > 0.f)
|
||||
{
|
||||
coverage = static_cast<float>(coverageCount) / cscale;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user