At edge cases, we can pad our image with 0s so the filter weights aren’t multiplied with nonexistent values. Another common solution is to pad the image by copying its edge pixel values.
(Page 8)