summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-24 19:32:50 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-24 19:32:50 +0000
commitabd3ee31ea51b47264986e4f5a3109582fbef97d (patch)
tree6780c5aad3a11d7e4472dba9373c7d40d756f075 /app
parent826fa729e3763314e75a8391af8b7ca50f3aa573 (diff)
downloadchromium_src-abd3ee31ea51b47264986e4f5a3109582fbef97d.zip
chromium_src-abd3ee31ea51b47264986e4f5a3109582fbef97d.tar.gz
chromium_src-abd3ee31ea51b47264986e4f5a3109582fbef97d.tar.bz2
Initialize destinations variables before calling GL functions
because if the context is lost those variables will be uninitialized. TEST=ran chrome, conformance tests, unit tests and hand edited gles2_demo to test BUG=none Review URL: http://codereview.chromium.org/5305005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67293 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/gfx/gl/gl_context.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/gfx/gl/gl_context.cc b/app/gfx/gl/gl_context.cc
index a07d30a..83c483b 100644
--- a/app/gfx/gl/gl_context.cc
+++ b/app/gfx/gl/gl_context.cc
@@ -15,7 +15,8 @@ namespace gfx {
std::string GLContext::GetExtensions() {
DCHECK(IsCurrent());
- return std::string(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
+ const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
+ return std::string(ext ? ext : "");
}
bool GLContext::HasExtension(const char* name) {