Commit 4b34a452 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

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

parent 81a84bb3
...@@ -1699,15 +1699,15 @@ static void X11DRV_DIB_SetImageBits_24( int lines, const BYTE *srcbits, ...@@ -1699,15 +1699,15 @@ static void X11DRV_DIB_SetImageBits_24( int lines, const BYTE *srcbits,
case 24: case 24:
{ {
if (bmpImage->bits_per_pixel == 24) { if (bmpImage->bits_per_pixel == 24) {
int tocopy = linebytes; int dstlinebytes = linebytes;
BYTE *dstpixel; BYTE *dstpixel;
BYTE *ptr = (BYTE *)(srcbits+left*3); BYTE *ptr = (BYTE *)(srcbits+left*3);
if (tocopy < 0 ) tocopy = -tocopy; if (dstlinebytes < 0 ) dstlinebytes = -dstlinebytes;
dstpixel = bmpImage->data + lines*tocopy + left*3; dstpixel = bmpImage->data + lines*dstlinebytes + left*3;
for(h = lines ; h-- ; ) { for(h = lines ; h-- ; ) {
dstpixel-=tocopy; dstpixel-=dstlinebytes;
memcpy(dstpixel,ptr,tocopy); memcpy(dstpixel,ptr,dstwidth*3);
ptr +=linebytes; ptr +=linebytes;
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment