Mesa (master): egl: compare the whole list of attributes
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 11 12:18:47 UTC 2019
Module: Mesa
Branch: master
Commit: 773ff93bc4b51c051f49c1c5198f56f5cea6665b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=773ff93bc4b51c051f49c1c5198f56f5cea6665b
Author: Eric Engestrom <eric.engestrom at intel.com>
Date: Thu Jun 6 21:30:49 2019 +0100
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 <eric.engestrom at intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
---
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;
}
/**
More information about the mesa-commit
mailing list