Limit buffer shift

This prevents a buffer error when less data was written than requested (no
tracks attached).