Alexander Dorofeyev : wined3d: Don't copy the extra line.

Alexandre Julliard julliard at winehq.org
Mon Apr 7 14:46:54 CDT 2008


Module: wine
Branch: master
Commit: 2f9e8a901cebf0c6c3c74e61c385322bfa7e212d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2f9e8a901cebf0c6c3c74e61c385322bfa7e212d

Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date:   Mon Apr  7 00:05:42 2008 +0300

wined3d: Don't copy the extra line.

biSizeImage has an extra line added to it, and passing it to memcpy can cause a 
crash.

---

 dlls/wined3d/surface_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c
index 9b7f100..7f689e2 100644
--- a/dlls/wined3d/surface_base.c
+++ b/dlls/wined3d/surface_base.c
@@ -545,7 +545,7 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface) {
     TRACE("DIBSection at : %p\n", This->dib.bitmap_data);
     /* copy the existing surface to the dib section */
     if(This->resource.allocatedMemory) {
-        memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, b_info->bmiHeader.biSizeImage);
+        memcpy(This->dib.bitmap_data, This->resource.allocatedMemory,  This->currentDesc.Height * IWineD3DSurface_GetPitch(iface));
     } else {
         /* This is to make LockRect read the gl Texture although memory is allocated */
         This->Flags &= ~SFLAG_INSYSMEM;




More information about the wine-cvs mailing list