diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 19:32:50 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 19:32:50 +0000 |
commit | abd3ee31ea51b47264986e4f5a3109582fbef97d (patch) | |
tree | 6780c5aad3a11d7e4472dba9373c7d40d756f075 /chrome/gpu | |
parent | 826fa729e3763314e75a8391af8b7ca50f3aa573 (diff) | |
download | chromium_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 'chrome/gpu')
-rw-r--r-- | chrome/gpu/gpu_info_collector_mac.mm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/gpu/gpu_info_collector_mac.mm b/chrome/gpu/gpu_info_collector_mac.mm index 9da958c..24c809d 100644 --- a/chrome/gpu/gpu_info_collector_mac.mm +++ b/chrome/gpu/gpu_info_collector_mac.mm @@ -81,13 +81,15 @@ static int GetShaderNumericVersion(int gl_major_version) { int shader_version = 0; if (gl_major_version == 1) { - char *gl_extensions_string = (char*)glGetString(GL_EXTENSIONS); - if (strstr(gl_extensions_string, "GL_ARB_shading_language_100")) { + const char *gl_extensions_string = (const char*)glGetString(GL_EXTENSIONS); + if (gl_extensions_string && + strstr(gl_extensions_string, "GL_ARB_shading_language_100")) { gl_hlsl_major = 1; gl_hlsl_minor = 0; } } else if (gl_major_version > 1) { - char *glsl_version_string = (char*)glGetString(GL_SHADING_LANGUAGE_VERSION); + const char *glsl_version_string = + (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION); if (glsl_version_string) sscanf(glsl_version_string, "%u.%u", &gl_hlsl_major, &gl_hlsl_minor); } |