Fixed Segment fault error. y and x values to setPixel were too high due to brush size. going over the size of the memory buffer in some cases and causing the error