[Encoder] fix a small range of slice idx