diff options
author | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-29 18:25:30 +0000 |
---|---|---|
committer | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-29 18:25:30 +0000 |
commit | 716b2c7e4d67d85529845e5ce4bf6ef3db06b43e (patch) | |
tree | 8264e2bbca1a3dbbd3a9e9e98f1152e714e43451 | |
parent | 1ec09d59c2b3115f395a49f226bf45630cebf720 (diff) | |
download | chromium_src-716b2c7e4d67d85529845e5ce4bf6ef3db06b43e.zip chromium_src-716b2c7e4d67d85529845e5ce4bf6ef3db06b43e.tar.gz chromium_src-716b2c7e4d67d85529845e5ce4bf6ef3db06b43e.tar.bz2 |
Check return value of XGetWindowAttributes.
There is a chance that |window_| is no longer valid and the call to
XGetWindowAttributes will fail and leave |attributes| uninitialized.
BUG=chromium-os:16986
TEST=manual
Review URL: http://codereview.chromium.org/7273036
git-svn-id: svn://svn.chromium.org/chrome/branches/782/src@90982 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ui/gfx/gl/gl_surface_glx.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/gfx/gl/gl_surface_glx.cc b/ui/gfx/gl/gl_surface_glx.cc index 30f20a6..0091da7 100644 --- a/ui/gfx/gl/gl_surface_glx.cc +++ b/ui/gfx/gl/gl_surface_glx.cc @@ -149,7 +149,10 @@ bool NativeViewGLSurfaceGLX::Initialize() { DCHECK(!glx_window_); XWindowAttributes attributes; - XGetWindowAttributes(g_display, window_, &attributes); + if (!XGetWindowAttributes(g_display, window_, &attributes)) { + LOG(ERROR) << "XGetWindowAttributes failed for window " << window_ << "."; + return false; + } XVisualInfo visual_template = {0}; visual_template.visualid = XVisualIDFromVisual(attributes.visual); |