JP2: prevent potentially infinite loop