Avoid potential division by zero [coverity 54716]

This commit is contained in:
Dane Springmeyer 2015-06-11 10:49:54 -07:00
parent 167708329d
commit 3b450f14bf

View file

@ -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++)
{