[4/6] winex11.drv: Don't call glXSwapBuffers if the context or the drawable are invalid.

Matteo Bruni matteo.mystral at gmail.com
Wed Mar 30 17:19:15 CDT 2011


-------------- next part --------------
From d8aa21e96c1ce13be16b5893dcfb1b6f6cd3bce9 Mon Sep 17 00:00:00 2001
From: Matteo Bruni <mbruni at codeweavers.com>
Date: Thu, 17 Mar 2011 22:51:04 +0100
Subject: winex11.drv: Don't call glXSwapBuffers if the context or the drawable are invalid.

---
 dlls/winex11.drv/opengl.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 81979ae..a7ec8c8 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -3818,6 +3818,20 @@ BOOL CDECL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev)
 
   TRACE("(%p)\n", physDev);
 
+  if (!ctx)
+  {
+      WARN("Using a NULL context, skipping\n");
+      SetLastError(ERROR_INVALID_HANDLE);
+      return FALSE;
+  }
+
+  if (!physDev->current_pf)
+  {
+      WARN("Using an invalid drawable, skipping\n");
+      SetLastError(ERROR_INVALID_HANDLE);
+      return FALSE;
+  }
+
   drawable = get_glxdrawable(physDev);
 
   wine_tsx11_lock();
-- 
1.7.3.4


More information about the wine-patches mailing list