[waffle] [PATCH] waffle: return accurate result from wegl_platform_init()
Frank Henigman
fjhenigman at google.com
Thu Jan 22 17:43:53 PST 2015
wegl_platform_init() now returns false if dlopen or dlsym fails.
Signed-off-by: Frank Henigman <fjhenigman at google.com>
---
Without this, if for some reason libEGL isn't loaded, wflinfo will
crash trying to call through a null pointer in the wegl_platform struct.
src/waffle/egl/wegl_platform.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/waffle/egl/wegl_platform.c b/src/waffle/egl/wegl_platform.c
index 196b14a..800025e 100644
--- a/src/waffle/egl/wegl_platform.c
+++ b/src/waffle/egl/wegl_platform.c
@@ -68,6 +68,7 @@ wegl_platform_init(struct wegl_platform *self)
wcore_errorf(WAFFLE_ERROR_FATAL,
"dlopen(\"%s\") failed: %s",
libEGL_filename, dlerror());
+ ok = false;
goto error;
}
@@ -77,6 +78,7 @@ wegl_platform_init(struct wegl_platform *self)
wcore_errorf(WAFFLE_ERROR_FATAL, \
"dlsym(\"%s\", \"" #function "\") failed: %s", \
libEGL_filename, dlerror()); \
+ ok = false; \
goto error; \
}
--
2.2.0.rc0.207.ga3a616c
More information about the waffle
mailing list