diff options
author | Erik Faye-Lund <[email protected]> | 2016-08-08 10:11:31 +0200 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2017-04-01 13:39:52 +0200 |
commit | c33807463e47204a55a5db6709f736e389ddb64c (patch) | |
tree | cc589f362b104c6b5fee247cac3022aadc23e0b2 /src/mesa | |
parent | 52f9ccefcb75a9d42307890d7714b1cd92e864cb (diff) |
st/mesa: avoid aliasing violation in st_cb_perfmon.c
Signed-off-by: Erik Faye-Lund <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_cb_perfmon.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_perfmon.c b/src/mesa/state_tracker/st_cb_perfmon.c index cd7fdc06173..23d32dcad47 100644 --- a/src/mesa/state_tracker/st_cb_perfmon.c +++ b/src/mesa/state_tracker/st_cb_perfmon.c @@ -308,16 +308,16 @@ st_GetPerfMonitorResult(struct gl_context *ctx, data[offset++] = cid; switch (type) { case GL_UNSIGNED_INT64_AMD: - *(uint64_t *)&data[offset] = result.u64; + memcpy(&data[offset], &result.u64, sizeof(uint64_t)); offset += sizeof(uint64_t) / sizeof(GLuint); break; case GL_UNSIGNED_INT: - *(uint32_t *)&data[offset] = result.u32; + memcpy(&data[offset], &result.u32, sizeof(uint32_t)); offset += sizeof(uint32_t) / sizeof(GLuint); break; case GL_FLOAT: case GL_PERCENTAGE_AMD: - *(GLfloat *)&data[offset] = result.f; + memcpy(&data[offset], &result.f, sizeof(GLfloat)); offset += sizeof(GLfloat) / sizeof(GLuint); break; } |