demux: adaptive: fix out of range exception