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 118604b0ae0..e9999e2232f 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> @@ -2293,6 +2294,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;
@@ -2313,6 +2316,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;