Fix decoding issues due to improper frame boundaries