Fixed end-of-line bug in X11DRV_DIB_SetImageBits_RLE4.

This commit is contained in:
Alexandre Julliard 1999-02-20 16:10:38 +00:00
parent b17522817b
commit fb02ee91b5
1 changed files with 4 additions and 4 deletions

View File

@ -357,20 +357,20 @@ static void X11DRV_DIB_SetImageBits_RLE4( int lines, const BYTE *bits,
if (length) { /* encoded */
c = *bits++;
while (length--) {
XPutPixel(bmpImage, x++, lines, colors[c >>4]);
if(x >= width) {
x = 0;
if(--lines < 0)
return;
}
XPutPixel(bmpImage, x++, lines, colors[c >>4]);
if (length) {
length--;
XPutPixel(bmpImage, x++, lines, colors[c & 0xf]);
if(x >= width) {
x = 0;
if(--lines < 0)
return;
}
XPutPixel(bmpImage, x++, lines, colors[c & 0xf]);
}
}
} else {
@ -396,20 +396,20 @@ static void X11DRV_DIB_SetImageBits_RLE4( int lines, const BYTE *bits,
default: /* absolute */
while (length--) {
c = *bits++;
XPutPixel(bmpImage, x++, lines, colors[c >> 4]);
if(x >= width) {
x = 0;
if(--lines < 0)
return;
}
XPutPixel(bmpImage, x++, lines, colors[c >> 4]);
if (length) {
length--;
XPutPixel(bmpImage, x++, lines, colors[c & 0xf]);
if(x >= width) {
x = 0;
if(--lines < 0)
return;
}
XPutPixel(bmpImage, x++, lines, colors[c & 0xf]);
}
}
if ((bits - begin) & 1)