Title: [221008] trunk/Source/WebCore
Revision
221008
Author
zandober...@gmail.com
Date
2017-08-22 02:51:22 -0700 (Tue, 22 Aug 2017)

Log Message

GLContext: zero-initialize the GLContext pointer in ThreadGlobalGLContext
https://bugs.webkit.org/show_bug.cgi?id=175819

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/GLContext.cpp: The ThreadGlobalGLContext object is
allocated on heap, so the embedded GLContext pointer can contain a
non-null value that can cause problems when e.g. checking for a current
GLContext on some specific thread on which a GLContext hasn't yet been
made current. Zero-initializing this pointer will avoid false positives
that can occur in these circumstances.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (221007 => 221008)


--- trunk/Source/WebCore/ChangeLog	2017-08-22 09:13:47 UTC (rev 221007)
+++ trunk/Source/WebCore/ChangeLog	2017-08-22 09:51:22 UTC (rev 221008)
@@ -1,3 +1,17 @@
+2017-08-22  Zan Dobersek  <zdober...@igalia.com>
+
+        GLContext: zero-initialize the GLContext pointer in ThreadGlobalGLContext
+        https://bugs.webkit.org/show_bug.cgi?id=175819
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/graphics/GLContext.cpp: The ThreadGlobalGLContext object is
+        allocated on heap, so the embedded GLContext pointer can contain a
+        non-null value that can cause problems when e.g. checking for a current
+        GLContext on some specific thread on which a GLContext hasn't yet been
+        made current. Zero-initializing this pointer will avoid false positives
+        that can occur in these circumstances.
+
 2017-08-21  Youenn Fablet  <you...@apple.com>
 
         [Cache API] Add support for Cache.add/addAll

Modified: trunk/Source/WebCore/platform/graphics/GLContext.cpp (221007 => 221008)


--- trunk/Source/WebCore/platform/graphics/GLContext.cpp	2017-08-22 09:13:47 UTC (rev 221007)
+++ trunk/Source/WebCore/platform/graphics/GLContext.cpp	2017-08-22 09:51:22 UTC (rev 221008)
@@ -50,7 +50,7 @@
     GLContext* context() { return m_context; }
 
 private:
-    GLContext* m_context;
+    GLContext* m_context { nullptr };
 };
 
 ThreadSpecific<ThreadGlobalGLContext>* ThreadGlobalGLContext::staticGLContext;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to