diff options
author | Matt Turner <mattst88@gmail.com> | 2016-05-26 15:52:33 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2016-07-26 12:12:27 -0700 |
commit | a1e9b72102f21426b6c4e6b47ac1742eb79d904f (patch) | |
tree | fe2807fe36313cb8757f2298c6e2a735e1865e28 /src/mesa/swrast | |
parent | 149309a424ed8c19354fc2c5830f927787f02ccc (diff) | |
download | external_mesa3d-a1e9b72102f21426b6c4e6b47ac1742eb79d904f.zip external_mesa3d-a1e9b72102f21426b6c4e6b47ac1742eb79d904f.tar.gz external_mesa3d-a1e9b72102f21426b6c4e6b47ac1742eb79d904f.tar.bz2 |
swrast: Avoid aliasing violation.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_masking.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index c95587b..c10bf1a 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -56,8 +56,8 @@ _swrast_mask_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, * Note that we're not using span->array->mask[] here. We could... */ if (span->array->ChanType == GL_UNSIGNED_BYTE) { - /* treat 4xGLubyte as 1xGLuint */ - const GLuint srcMask = *((GLuint *) ctx->Color.ColorMask[buf]); + GLuint srcMask; + memcpy(&srcMask, ctx->Color.ColorMask[buf], sizeof(srcMask)); const GLuint dstMask = ~srcMask; const GLuint *dst = (const GLuint *) rbPixels; GLuint *src = (GLuint *) span->array->rgba8; |