diff options
author | George Burgess IV <gbiv@google.com> | 2021-12-08 10:41:43 -0800 |
---|---|---|
committer | George Burgess IV <gbiv@google.com> | 2021-12-08 10:43:53 -0800 |
commit | 7cf0efdb7d43035e560c932703cd968088a089c9 (patch) | |
tree | bb2d42bca235d54d7c90ef81cd3abbfefc3a2020 | |
parent | 7c7ed93e4a00d141ea87d2ecf424fd12b399b2a0 (diff) | |
download | vulkan-cereal-7cf0efdb7d43035e560c932703cd968088a089c9.tar.gz |
stream-servers: explicitly zero-initialize variables
Clang's static analyzer complains that `createSharedTrivialContext`
might not initialize these properly, which seems to be correct, since
this function has an early exit if we fail to get a proper config
object.
We have a compiler option that zero-initializes all stack variables
anyway, so this is no functional change. Still, it seems best to init
these variables to make our tooling happy & minimize reliance on this
option going forward.
Bug: 206470603
Test: TreeHugger
Change-Id: I56c0e73c8d91105cb6d59b8e2f9cb98739905961
-rw-r--r-- | stream-servers/FrameBuffer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stream-servers/FrameBuffer.cpp b/stream-servers/FrameBuffer.cpp index bf8e5c05..e2a00f9d 100644 --- a/stream-servers/FrameBuffer.cpp +++ b/stream-servers/FrameBuffer.cpp @@ -3503,8 +3503,8 @@ bool FrameBuffer::platformImportResource(uint32_t handle, uint32_t type, void* r void* FrameBuffer::platformCreateSharedEglContext(void) { AutoLock lock(m_lock); - EGLContext context; - EGLSurface surface; + EGLContext context = 0; + EGLSurface surface = 0; createSharedTrivialContext(&context, &surface); void* underlyingContext = s_egl.eglGetNativeContextANDROID(m_eglDisplay, context); |