Fixed a segfault when trying to draw a line to the right-bottom corner of the
screen