Zero initialize context var used to smuggle swizzle control bytes.

MSan now implements stricter checks when passing uninitialized values in
parameters or return values, so even though the the uninitialized bytes
would never be consumed, MSan is still unhappy.

The simple fix is to just zero initialize the entire context value.

Bug: 1369167
Change-Id: If22ce9b0ecae8ccc59b4396c3cf1618fa14fd192
Commit-Queue: Daniel Cheng <>
Reviewed-by: Brian Osman <>
Reviewed-by: Kevin Lubick <>
diff --git a/src/gpu/Swizzle.cpp b/src/gpu/Swizzle.cpp
index 5bf2e2a..e37a5b0 100644
--- a/src/gpu/Swizzle.cpp
+++ b/src/gpu/Swizzle.cpp
@@ -35,7 +35,7 @@
             static_assert(sizeof(uintptr_t) >= 4 * sizeof(char));
             // Rather than allocate the 4 control bytes on the heap somewhere, just jam them right
             // into a uintptr_t context.
-            uintptr_t ctx;
+            uintptr_t ctx = {};
             memcpy(&ctx, this->asString().c_str(), 4 * sizeof(char));
             pipeline->append(SkRasterPipelineOp::swizzle, ctx);