kmvc: Clip pixel position to valid range