fix a small range of slice idx
Merge pull request #1446 from sijchen/for_format

[Encoder] fix a small range of slice idx