diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index b86dd7b5423..b827fa8ed92 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1021,17 +1021,18 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) { if( (NP2_REPACK == wined3d_settings.nonpower2_mode || This->resource.usage & WINED3DUSAGE_RENDERTARGET)) { b_info->bmiHeader.biWidth = This->currentDesc.Width; b_info->bmiHeader.biHeight = -This->currentDesc.Height; + b_info->bmiHeader.biSizeImage = This->currentDesc.Width * This->currentDesc.Height * This->bytesPerPixel; /* Use the full pow2 image size(assigned below) because LockRect * will need it for a full glGetTexImage call */ } else { b_info->bmiHeader.biWidth = This->pow2Width; b_info->bmiHeader.biHeight = -This->pow2Height; + b_info->bmiHeader.biSizeImage = This->resource.size; } b_info->bmiHeader.biPlanes = 1; b_info->bmiHeader.biBitCount = This->bytesPerPixel * 8; - b_info->bmiHeader.biSizeImage = This->resource.size; b_info->bmiHeader.biXPelsPerMeter = 0; b_info->bmiHeader.biYPelsPerMeter = 0; @@ -1092,7 +1093,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) { /* copy the existing surface to the dib section */ if(This->resource.allocatedMemory) { - memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, This->resource.size); + memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, b_info->bmiHeader.biSizeImage); /* We won't need that any more */ HeapFree(GetProcessHeap(), 0, This->resource.allocatedMemory); } else { diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 47733c8e130..9f984b0aa2d 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -191,7 +191,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) } else if (!strcmp(buffer,"repack")) { - TRACE("Repacking non-power2 textre\n"); + TRACE("Repacking non-power2 textures\n"); wined3d_settings.nonpower2_mode = NP2_REPACK; } /* There will be a couple of other choices for nonpow2, they are: TextureRecrangle and OpenGL 2 */