i915: Avoid aliasing violation.
authorMatt Turner <mattst88@gmail.com>
Thu, 28 Jul 2016 19:44:41 +0000 (12:44 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 1 Aug 2016 19:09:17 +0000 (12:09 -0700)
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i915/intel_clear.c

index 8cf7c142f317da57c33ccfe124d20ecbc8fcf695..4306826b876ea4a349a9d98e0551b263e0d99c3d 100644 (file)
@@ -81,7 +81,7 @@ static void
 intelClear(struct gl_context *ctx, GLbitfield mask)
 {
    struct intel_context *intel = intel_context(ctx);
-   const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask[0]);
+   GLuint colorMask;
    GLbitfield tri_mask = 0;
    GLbitfield blit_mask = 0;
    GLbitfield swrast_mask = 0;
@@ -89,6 +89,8 @@ intelClear(struct gl_context *ctx, GLbitfield mask)
    struct intel_renderbuffer *irb;
    int i;
 
+   memcpy(&colorMask, &ctx->Color.ColorMask[0], sizeof(colorMask));
+
    if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT)) {
       intel->front_buffer_dirty = true;
    }