diff options
author | Chad Versace <[email protected]> | 2012-07-20 15:41:27 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2012-07-20 16:01:57 -0700 |
commit | 735070c45b403a9631415b09e9fd519f601f0229 (patch) | |
tree | 3fe0dde0e14b103ebd77d9a5ab8a3cdc89348fd8 /src | |
parent | 1a8f6ac5a46dfbb8287ee2bacdd11c3a1a3a65c7 (diff) |
i830: Fix stack corruption
Found by compiler warning:
i830_texstate.c:131:28: warning: argument to 'sizeof' in 'memset' call
is the same expression as the destination; did you mean to
dereference it? [-Wsizeof-pointer-memaccess]
memset(state, 0, sizeof(state));
~~~~~ ^~~~~
On 64-bit systems, memset here would write an extra 4 bytes.
Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_texstate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 5f32b9250d0..b7d2d33c131 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -128,7 +128,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) GLubyte border[4]; GLuint dst_x, dst_y; - memset(state, 0, sizeof(state)); + memset(state, 0, sizeof(*state)); /*We need to refcount these. */ |