c_viterbi(): check maxIndex