Cryptanalysis of an ergodic chaotic cipher