Check this:
2440 while (len--) 2441 { 2442 if ((s->r==COLORMAX && 2443 s->g==COLORMAX && 2444 s->b==COLORMAX))
2448 else
Can l be NULL only when s->r == s->g == s->b == COLORMAX? because if not..
2450 d->r=MINIMUM(s->r+l->r,COLORMAX);
... this is looking a bit silly:
2458 if (l) l++;