add: width = width * 3;
context: renderDGradient(unsigned width, unsigned height, int r0, int g0, int b0,		int rf, int gf, int bf){    RImage *image, *tmp;    int i, j, offset;    float a;    char *ptr;    if (width == 1)        return renderVGradient(width, height, r0, g0, b0, rf, gf, bf);    else if (height == 1)        return renderHGradient(width, height, r0, g0, b0, rf, gf, bf);    image = RCreateImage(width, height, False);    if (!image) {        return NULL;    }    tmp = renderHGradient(2*width-1, 1, r0, g0, b0, rf, gf, bf);    if (!tmp) {        RDestroyImage(image);        return NULL;    }        ptr = tmp->data;    width *= 3;    a = ((float)(width - 1))/((float)(height - 1));    /* copy the first line to the other lines with corresponding offset */    for (i=0, j=0, offset=0; i<height; i++, j += width) {        offset = (int)(a*i+0.5)*3;	memcpy(&(image->data[j]), &ptr[offset], width);    }    RDestroyImage(tmp);    return image;}