aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2016-05-26 15:53:30 -0700
committerMatt Turner <[email protected]>2016-07-26 12:12:27 -0700
commitf5ac1d366e81ee9ad11f44ee64a5b556bc6f1989 (patch)
tree7e3891a9b99e17637ae5c9effbc9f11bb99cc1c9 /src/mesa/main
parenta1e9b72102f21426b6c4e6b47ac1742eb79d904f (diff)
mesa: Avoid aliasing violation in FXT1.
Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texcompress_fxt1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index ae339e11d39..c5646fbd7a3 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -177,8 +177,8 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
#define LL_RMS_D 10 /* fault tolerance (maximum delta) */
#define LL_RMS_E 255 /* fault tolerance (maximum error) */
#define ALPHA_TS 2 /* alpha threshold: (255 - ALPHA_TS) deemed opaque */
-#define ISTBLACK(v) (*((GLuint *)(v)) == 0)
-
+static const GLuint zero = 0;
+#define ISTBLACK(v) (memcmp(&(v), &zero, sizeof(zero)) == 0)
/*
* Define a 64-bit unsigned integer type and macros