From 773ff93bc4b51c051f49c1c5198f56f5cea6665b Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Thu, 6 Jun 2019 21:30:49 +0100 Subject: [PATCH] egl: compare the whole list of attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit `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 --- src/egl/main/egldisplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } /** -- 2.30.2