[PATCH] gdi32: initialize src fully (Coverity)

Marcus Meissner marcus at jet.franken.de
Tue Dec 20 02:54:24 CST 2011


Hi,

The .layout member is not initialized, but the whole struct
is copied to "dst", triggering an uninitialized warning.

CID 5498.

Ciao, Marcus
---
 dlls/gdi32/bitmap.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c
index b5547a4..4544b95 100644
--- a/dlls/gdi32/bitmap.c
+++ b/dlls/gdi32/bitmap.c
@@ -529,12 +529,9 @@ static void set_initial_bitmap_bits( HBITMAP hbitmap, BITMAPOBJ *bmp )
     bits.free = NULL;
     bits.param = NULL;
 
-    src.x      = 0;
-    src.y      = 0;
+    memset (&src, 0, sizeof(src));
     src.width  = bmp->bitmap.bmWidth;
     src.height = bmp->bitmap.bmHeight;
-    src.visrect.left   = 0;
-    src.visrect.top    = 0;
     src.visrect.right  = bmp->bitmap.bmWidth;
     src.visrect.bottom = bmp->bitmap.bmHeight;
     dst = src;
-- 
1.7.3.4




More information about the wine-patches mailing list