transform: fix off-by-one (fixes #10505)