Only copy dstwidth*3 bytes in the 24bit case.

This commit is contained in:
Marcus Meissner 2000-04-11 19:38:12 +00:00 committed by Alexandre Julliard
parent 81a84bb387
commit 4b34a45203
1 changed files with 5 additions and 5 deletions

View File

@ -1699,15 +1699,15 @@ static void X11DRV_DIB_SetImageBits_24( int lines, const BYTE *srcbits,
case 24:
{
if (bmpImage->bits_per_pixel == 24) {
int tocopy = linebytes;
int dstlinebytes = linebytes;
BYTE *dstpixel;
BYTE *ptr = (BYTE *)(srcbits+left*3);
if (tocopy < 0 ) tocopy = -tocopy;
dstpixel = bmpImage->data + lines*tocopy + left*3;
if (dstlinebytes < 0 ) dstlinebytes = -dstlinebytes;
dstpixel = bmpImage->data + lines*dstlinebytes + left*3;
for(h = lines ; h-- ; ) {
dstpixel-=tocopy;
memcpy(dstpixel,ptr,tocopy);
dstpixel-=dstlinebytes;
memcpy(dstpixel,ptr,dstwidth*3);
ptr +=linebytes;
}
break;