buffer: int offset range check was switched