diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 99d1f8f5d0a9..fb3816e3c662 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2017-08-22 Zan Dobersek + + 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 Daniel Bates Cleanup TextPainter diff --git a/Source/WebCore/platform/graphics/GLContext.cpp b/Source/WebCore/platform/graphics/GLContext.cpp index 33c97231017a..599dcc017278 100644 --- a/Source/WebCore/platform/graphics/GLContext.cpp +++ b/Source/WebCore/platform/graphics/GLContext.cpp @@ -50,7 +50,7 @@ class ThreadGlobalGLContext { GLContext* context() { return m_context; } private: - GLContext* m_context; + GLContext* m_context { nullptr }; }; ThreadSpecific* ThreadGlobalGLContext::staticGLContext;