In Image/blit.c:
What good are the if sections before else on line 250, 251:
if (x2<0) x2=0; else if (x2>=img->xsize) x2=img->xsize-1; if (y2<0) y2=0; else if (y2>=img->ysize) y2=img->ysize-1;
On line 246 we just checked that that wasn't true:
if( ! (( x2 < 0) || (y2 < 0) || (x1>=img->xsize) || (y1>=img->ysize))) {