Skip to content

Commit

Permalink
Merge branch 'fixes' into 'master'
Browse files Browse the repository at this point in the history
Fix crash on non-hybris devices. Fixes MER#2031

See merge request mer-core/lipstick!110
  • Loading branch information
pvuorela committed Mar 29, 2019
2 parents da781e1 + 281ca0f commit 9836b26
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/compositor/eglhybrisfunctions.cpp
Expand Up @@ -17,9 +17,17 @@

#include <QGlobalStatic>

static const char* checked_strstr(const char *haystack, const char *needle)
{
if (!haystack || !needle) {
return 0;
}
return strstr(haystack, needle);
}

struct SupportedEglHybrisFunctions : public EglHybrisFunctions
{
const bool supported = strstr(eglQueryString(eglGetDisplay(EGL_DEFAULT_DISPLAY), EGL_EXTENSIONS), "EGL_HYBRIS_native_buffer2") != 0
const bool supported = checked_strstr(eglQueryString(eglGetDisplay(EGL_DEFAULT_DISPLAY), EGL_EXTENSIONS), "EGL_HYBRIS_native_buffer2") != 0
&& glEGLImageTargetTexture2DOES
&& eglCreateImageKHR
&& eglDestroyImageKHR
Expand Down

0 comments on commit 9836b26

Please sign in to comment.