[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - vcl/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Wed Nov 5 10:24:06 PST 2014


 vcl/source/opengl/OpenGLContext.cxx |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

New commits:
commit f1e4ea6d59964e2488d622255843b16aec422d29
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Nov 5 18:29:40 2014 +0100

    prevent invalid memory access in dbgutil code
    
    Change-Id: I071a9375868c1cb262c4f45871ad7d3c26bb7271

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index a340304..b1cec57 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -573,14 +573,19 @@ bool OpenGLContext::ImplInit()
         if (!pFBC)
             return false;
 
-        int nContextAttribs[] =
+        if (best_fbc != -1)
         {
-            GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
-            GLX_CONTEXT_MINOR_VERSION_ARB, 2,
-            None
-        };
-        m_aGLWin.ctx = glXCreateContextAttribsARB(m_aGLWin.dpy, pFBC[best_fbc], 0, GL_TRUE, nContextAttribs);
-        SAL_INFO_IF(m_aGLWin.ctx, "vcl.opengl", "created a 3.2 core context");
+            int nContextAttribs[] =
+            {
+                GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+                GLX_CONTEXT_MINOR_VERSION_ARB, 2,
+                None
+            };
+            m_aGLWin.ctx = glXCreateContextAttribsARB(m_aGLWin.dpy, pFBC[best_fbc], 0, GL_TRUE, nContextAttribs);
+            SAL_INFO_IF(m_aGLWin.ctx, "vcl.opengl", "created a 3.2 core context");
+        }
+        else
+            SAL_WARN("vcl.opengl", "unable to find correct FBC");
 
     }
 #endif


More information about the Libreoffice-commits mailing list