Mask off out-of-bounds areas.