diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-10 07:54:26 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-10 07:54:26 +0000 |
commit | 886503a4e44ffb44d0b9de24dbcc0c48f549f251 (patch) | |
tree | 91887e87727b7583a0bd6122a5ab6d938c088e7b /gpu | |
parent | fa905af81e6ff5d7fdc79bda91e0dcfb57e8051d (diff) | |
download | chromium_src-886503a4e44ffb44d0b9de24dbcc0c48f549f251.zip chromium_src-886503a4e44ffb44d0b9de24dbcc0c48f549f251.tar.gz chromium_src-886503a4e44ffb44d0b9de24dbcc0c48f549f251.tar.bz2 |
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
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.cc | 3 |
1 files changed, 3 insertions, 0 deletions
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<const char*>(GetStringHelper(GL_EXTENSIONS)); + if (!extensions) + return false; + int length = strlen(ext); while (true) { int n = strcspn(extensions, " "); |