From 886503a4e44ffb44d0b9de24dbcc0c48f549f251 Mon Sep 17 00:00:00 2001 From: "apatrick@chromium.org" Date: Fri, 10 May 2013 07:54:26 +0000 Subject: Fix null dereference in GLES2Implementation::IsExtensionAvailable. glGetString (and GLES2Implementation::GetStringHelper) can return null on error, for example context lost. This makes IsExtensionAvailable always return false if there is an error. BUG=239572 Review URL: https://chromiumcodereview.appspot.com/14813022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199423 0039d316-1c4b-4281-b951-d872f2087c98 --- gpu/command_buffer/client/gles2_implementation.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gpu') diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 84baef0..d3b1208 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -265,6 +265,9 @@ void GLES2Implementation::WaitForCmd() { bool GLES2Implementation::IsExtensionAvailable(const char* ext) { const char* extensions = reinterpret_cast(GetStringHelper(GL_EXTENSIONS)); + if (!extensions) + return false; + int length = strlen(ext); while (true) { int n = strcspn(extensions, " "); -- cgit v1.1