From: Eric Engestrom Date: Thu, 6 Jun 2019 20:30:49 +0000 (+0100) Subject: egl: compare the whole list of attributes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=773ff93bc4b51c051f49c1c5198f56f5cea6665b;p=mesa.git egl: compare the whole list of attributes `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 Reviewed-by: Eric Anholt Reviewed-by: Tapani Pälli --- diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 91655b73454..f09b2e96403 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -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; } /**