fixed crash by checking vector range
Merge branch 'bug-18338-imageStatisticCrash'