Index: /trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c	(revision 55574)
+++ /trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c	(revision 55575)
@@ -715,12 +715,13 @@
 {
     CRContext *current = GetCurrentContext();
-
-    if (ctx == NULL)
-        ctx = defaultContext;
-
-    if (current == ctx)
+    CRContext *pLocalCtx = ctx;
+
+    if (pLocalCtx == NULL)
+        pLocalCtx = defaultContext;
+
+    if (current == pLocalCtx)
         return; /* no-op */
 
-    CRASSERT(ctx);
+    CRASSERT(pLocalCtx);
 
     if (g_bVBoxEnableDiffOnMakeCurrent && current) {
@@ -728,15 +729,15 @@
            we may not have one, aka the packspu */
         if (diff_api.AlphaFunc)
-            crStateSwitchContext( current, ctx );
-    }
-
-#ifdef CHROMIUM_THREADSAFE
-    SetCurrentContext(ctx);
+            crStateSwitchContext( current, pLocalCtx );
+    }
+
+#ifdef CHROMIUM_THREADSAFE
+    SetCurrentContext(pLocalCtx);
 #else
-    __currentContext = ctx;
+    __currentContext = pLocalCtx;
 #endif
 
     /* ensure matrix state is also current */
-    crStateMatrixMode(ctx->transform.matrixMode);
+    crStateMatrixMode(pLocalCtx->transform.matrixMode);
 }
 
@@ -748,21 +749,22 @@
 {
     CRContext *current = GetCurrentContext();
-
-    if (ctx == NULL && !fCleanupDefault)
-        ctx = defaultContext;
-
-    if (current == ctx)
+    CRContext *pLocalCtx = ctx;
+
+    if (pLocalCtx == NULL && !fCleanupDefault)
+        pLocalCtx = defaultContext;
+
+    if (current == pLocalCtx)
         return; /* no-op */
 
 #ifdef CHROMIUM_THREADSAFE
-    SetCurrentContext(ctx);
+    SetCurrentContext(pLocalCtx);
 #else
-    __currentContext = ctx;
-#endif
-
-    if (ctx)
+    __currentContext = pLocalCtx;
+#endif
+
+    if (pLocalCtx)
     {
         /* ensure matrix state is also current */
-        crStateMatrixMode(ctx->transform.matrixMode);
+        crStateMatrixMode(pLocalCtx->transform.matrixMode);
     }
 }
