Avoid potential division by zero [coverity 54716]
This commit is contained in:
parent
167708329d
commit
3b450f14bf
1 changed files with 1 additions and 1 deletions
2
deps/agg/src/agg_image_filters.cpp
vendored
2
deps/agg/src/agg_image_filters.cpp
vendored
|
@ -63,7 +63,7 @@ void image_filter_lut::normalize()
|
|||
|
||||
if(sum == image_filter_scale) break;
|
||||
|
||||
double k = double(image_filter_scale) / double(sum);
|
||||
double k = (sum > 0) ? double(image_filter_scale) / double(sum) : 1;
|
||||
sum = 0;
|
||||
for(j = 0; j < m_diameter; j++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue