mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-12-06 07:11:44 +01:00
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…
x
Reference in New Issue
Block a user