egl: compare the whole list of attributes
authorEric Engestrom <eric.engestrom@intel.com>
Thu, 6 Jun 2019 20:30:49 +0000 (21:30 +0100)
committerEric Engestrom <eric@engestrom.ch>
Tue, 11 Jun 2019 12:18:09 +0000 (12:18 +0000)
`memcmp()` compares a given number of bytes, but `EGLAttrib` is larger than a byte.

Fixes: 8e991ce5397598ceb422 "egl: handle the full attrib list in display::options"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/egl/main/egldisplay.c

index 91655b7..f09b2e9 100644 (file)
@@ -232,7 +232,7 @@ _eglSameAttribs(const EGLAttrib *a, const EGLAttrib *b)
       return EGL_TRUE;
 
    /* otherwise, compare the lists */
-   return memcmp(a, b, na) == 0 ? EGL_TRUE : EGL_FALSE;
+   return memcmp(a, b, na * sizeof(a[0])) == 0 ? EGL_TRUE : EGL_FALSE;
 }
 
 /**