diff options
author | Russell Brenner <russellbrenner@google.com> | 2010-11-05 11:55:06 -0700 |
---|---|---|
committer | Russell Brenner <russellbrenner@google.com> | 2010-11-05 11:55:06 -0700 |
commit | ba25389b2d1f3d6603ed1ea816278f91a4ca95c0 (patch) | |
tree | 933222c2bb7984d4ea4d855d6eb458f823151a6b | |
parent | a1e806ed3b2d9e2727d08cc2a3958fce501f6f33 (diff) | |
download | external_webkit-ba25389b2d1f3d6603ed1ea816278f91a4ca95c0.zip external_webkit-ba25389b2d1f3d6603ed1ea816278f91a4ca95c0.tar.gz external_webkit-ba25389b2d1f3d6603ed1ea816278f91a4ca95c0.tar.bz2 |
Null-check in GLUtils::isEGLImageSupported()
Avoid segfault by checking for null strings in GLUtils::isEGLImageSupported() and
GLUtils::isEGLFenceSyncSupported().
Bug: 3169653
-rw-r--r-- | WebCore/platform/graphics/android/GLUtils.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/WebCore/platform/graphics/android/GLUtils.cpp b/WebCore/platform/graphics/android/GLUtils.cpp index e9c0796..1c84fe2 100644 --- a/WebCore/platform/graphics/android/GLUtils.cpp +++ b/WebCore/platform/graphics/android/GLUtils.cpp @@ -121,14 +121,15 @@ bool GLUtils::isEGLImageSupported() { const char* eglExtensions = eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); const char* glExtensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); - return strstr(eglExtensions, "EGL_KHR_image_base") && + return eglExtensions && glExtensions && + strstr(eglExtensions, "EGL_KHR_image_base") && strstr(eglExtensions, "EGL_KHR_gl_texture_2D_image") && strstr(glExtensions, "GL_OES_EGL_image"); } bool GLUtils::isEGLFenceSyncSupported() { const char* eglExtensions = eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); - return strstr(eglExtensions, "EGL_KHR_fence_sync"); + return eglExtensions && strstr(eglExtensions, "EGL_KHR_fence_sync"); } ///////////////////////////////////////////////////////////////////////////////////////// |