From 4b34a45203533fd404bd42c8cf7559f173a3f123 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 11 Apr 2000 19:38:12 +0000 Subject: [PATCH] Only copy dstwidth*3 bytes in the 24bit case. --- graphics/x11drv/dib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c index f9704b53b7..6f7a1093c9 100644 --- a/graphics/x11drv/dib.c +++ b/graphics/x11drv/dib.c @@ -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; -- 2.32.0.93.g670b81a890