Fix build problem with MSVC
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
old mode 100644
new mode 100755
index d06644f..7b8d934
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1504,15 +1504,19 @@
           * or not bound to a user-created FBO.
           */
          if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
-            _mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
          /* fix up the fb fields - these will end up wrong otherwise
-            if the DRIdrawable changes, and everything relies on them.
-            This is a bit messy (same as needed in _mesa_BindFramebufferEXT) */
+          * if the DRIdrawable changes, and everything relies on them.
+          * This is a bit messy (same as needed in _mesa_BindFramebufferEXT)
+	  */
             int i;
             GLenum buffers[MAX_DRAW_BUFFERS];
+
+            _mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
+
             for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
                buffers[i] = newCtx->Color.DrawBuffer[i];
             }
+
             _mesa_drawbuffers(newCtx, newCtx->Const.MaxDrawBuffers, buffers, NULL);
          }
          if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {