Skip to content
Snippets Groups Projects
Commit 735070c4 authored by Lina Versace's avatar Lina Versace
Browse files

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: default avatarBrian Paul <brianp@vmware.com>
Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
parent 1a8f6ac5
No related branches found
No related tags found
No related merge requests found
...@@ -128,7 +128,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) ...@@ -128,7 +128,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
GLubyte border[4]; GLubyte border[4];
GLuint dst_x, dst_y; GLuint dst_x, dst_y;
memset(state, 0, sizeof(state)); memset(state, 0, sizeof(*state));
/*We need to refcount these. */ /*We need to refcount these. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment