When doing 2D image painting the region on the GPU that is updated could be out of bounds of the texture, resulting in a crash. This PR fixes this by clamping the gpu region to update to the actual image size. Pull Request: https://projects.blender.org/blender/blender/pulls/144545