1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Fixed a crashing bug in the multi vertical gradient code.

This commit is contained in:
dan
2000-01-17 04:30:52 +00:00
parent 14939535b6
commit 0d1935e3d8

View File

@@ -398,6 +398,7 @@ renderMVGradient(unsigned width, unsigned height, RColor **colors, int count)
gg = g>>16;
bb = b>>16;
if (k<height) {
tmp = ptr;
for (x=0; x<width/4; x++) {
*ptr++ = rr; *ptr++ = gg; *ptr++ = bb;
@@ -409,12 +410,14 @@ renderMVGradient(unsigned width, unsigned height, RColor **colors, int count)
case 3: *ptr++ = rr; *ptr++ = gg; *ptr++ = bb;
case 2: *ptr++ = rr; *ptr++ = gg; *ptr++ = bb;
case 1: *ptr++ = rr; *ptr++ = gg; *ptr++ = bb;
default: break;
}
for (j=k+1; j<width; j++) {
for (j=k+1; j<height; j++) {
memcpy(ptr, tmp, width*3);
ptr += width*3;
}
}
return image;
}