def read_vx(pointdata):
    """Read a variable-length index."""
    if pointdata[0] != 255:
        index = pointdata[0] * 256 + pointdata[1]
        size = 2
    else:
        index = pointdata[1] * 65536 + pointdata[2] * 256 + pointdata[3]
        size = 4
    return index, size
