summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2021-12-08 10:41:43 -0800
committerGeorge Burgess IV <gbiv@google.com>2021-12-08 10:43:53 -0800
commit7cf0efdb7d43035e560c932703cd968088a089c9 (patch)
treebb2d42bca235d54d7c90ef81cd3abbfefc3a2020
parent7c7ed93e4a00d141ea87d2ecf424fd12b399b2a0 (diff)
downloadvulkan-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.cpp4
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);