Patch to bypass code when no pixels checked

There is a feasible (although I believe very unlikely)
code path where no pixels will be checked, resulting
in a number of variables not being appropriately
set.  This code will bypass the codes if no pixels
were checked.

Fixes coverity 746805 (possible division by zero)