[PATCH] wing32: copy the correct bitmap size, warn about missing palette copy (Coverity)

Marcus Meissner marcus at jet.franken.de
Mon Nov 14 05:09:16 CST 2011


Hi,

Was copying the RGBQUAD[1] variable part of the struct.

Will usually get BI_RGB I guess, so I am leaving palette copying
out for now.
CID 1788

Ciao, Marcus
---
 dlls/wing32/wing32.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/wing32/wing32.c b/dlls/wing32/wing32.c
index ac74986..9e92484 100644
--- a/dlls/wing32/wing32.c
+++ b/dlls/wing32/wing32.c
@@ -24,6 +24,9 @@
 #include "winbase.h"
 #include "wingdi.h"
 #include "winuser.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wing);
 
 /***********************************************************************
  *           WinGCreateDC   (WING32.@)
@@ -72,7 +75,8 @@ void * WINAPI WinGGetDIBPointer( HBITMAP hbmp, BITMAPINFO *bmi )
 
     if (GetObjectW( hbmp, sizeof(ds), &ds ) == sizeof(ds))
     {
-        memcpy( &bmi->bmiHeader, &ds.dsBmih, sizeof(*bmi) );
+        memcpy( &bmi->bmiHeader, &ds.dsBmih, sizeof(ds.dsBmih) );
+        if (ds.dsBmih.biCompression != BI_RGB) FIXME("Needs to copy more of the bitmapinfo?\n");
         return ds.dsBm.bmBits;
     }
     return NULL;
-- 
1.7.3.4




More information about the wine-patches mailing list