Fixed #6346 (pointer calculation overflow)