Skip to content

Commit

Permalink
Merge r221008 - GLContext: zero-initialize the GLContext pointer in T…
Browse files Browse the repository at this point in the history
…hreadGlobalGLContext

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.
  • Loading branch information
zdobersek authored and carlosgcampos committed Aug 28, 2017
1 parent 148ca19 commit 1ac2565
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
2017-08-22 Zan Dobersek <zdobersek@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 Daniel Bates <dabates@apple.com>

Cleanup TextPainter
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/GLContext.cpp
Expand Up @@ -50,7 +50,7 @@ class ThreadGlobalGLContext {
GLContext* context() { return m_context; }

private:
GLContext* m_context;
GLContext* m_context { nullptr };
};

ThreadSpecific<ThreadGlobalGLContext>* ThreadGlobalGLContext::staticGLContext;
Expand Down

0 comments on commit 1ac2565

Please sign in to comment.