egl: fix uninitialized values
authorDylan Noblesmith <nobled@dreamwidth.org>
Sun, 1 Apr 2012 18:48:13 +0000 (18:48 +0000)
committerDylan Noblesmith <nobled@dreamwidth.org>
Fri, 13 Apr 2012 14:25:08 +0000 (14:25 +0000)
Noticed by clang:

eglimage.c:48: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(attrs, 0, sizeof(attrs));
          ~~~~~            ^~~~~

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/egl/main/eglimage.c

index d5deae7..1174d0a 100644 (file)
@@ -45,7 +45,7 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
 
    (void) dpy;
 
-   memset(attrs, 0, sizeof(attrs));
+   memset(attrs, 0, sizeof(*attrs));
    attrs->ImagePreserved = EGL_FALSE;
    attrs->GLTextureLevel = 0;
    attrs->GLTextureZOffset = 0;