From: Zebediah Figura zfigura@codeweavers.com
--- dlls/winex11.drv/window.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 70a29d24fb1..8620ce1ec55 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -26,6 +26,7 @@
#include "config.h"
+#include <assert.h> #include <stdarg.h> #include <stdlib.h> #include <stdio.h> @@ -2297,6 +2298,8 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, struct x11drv_escape_set_drawable escape; HWND parent;
+ assert( hwnd ); + escape.code = X11DRV_SET_DRAWABLE; escape.mode = IncludeInferiors;
@@ -2317,6 +2320,10 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, } else { + /* gcc detects that "escape.drawable" may be used uninitialized if + * "hwnd" is NULL */ + escape.drawable = 0; + /* find the first ancestor that has a drawable */ for (parent = hwnd; parent && parent != top; parent = NtUserGetAncestor( parent, GA_PARENT )) if ((escape.drawable = X11DRV_get_whole_window( parent ))) break;