summaryrefslogtreecommitdiffstats
path: root/media/tools
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 /media/tools
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 'media/tools')
-rw-r--r--media/tools/player_x11/gl_video_renderer.cc6
-rw-r--r--media/tools/player_x11/gles_video_renderer.cc4
2 files changed, 5 insertions, 5 deletions
diff --git a/media/tools/player_x11/gl_video_renderer.cc b/media/tools/player_x11/gl_video_renderer.cc
index eef1a25..68b317f 100644
--- a/media/tools/player_x11/gl_video_renderer.cc
+++ b/media/tools/player_x11/gl_video_renderer.cc
@@ -169,7 +169,7 @@ bool GlVideoRenderer::OnInitialize(media::VideoDecoder* decoder) {
glGetShaderiv(vertex_shader, GL_COMPILE_STATUS, &result);
if (!result) {
char log[kErrorSize];
- int len;
+ int len = 0;
glGetShaderInfoLog(vertex_shader, kErrorSize - 1, &len, log);
log[kErrorSize - 1] = 0;
LOG(FATAL) << log;
@@ -186,7 +186,7 @@ bool GlVideoRenderer::OnInitialize(media::VideoDecoder* decoder) {
glGetShaderiv(fragment_shader, GL_COMPILE_STATUS, &result);
if (!result) {
char log[kErrorSize];
- int len;
+ int len = 0;
glGetShaderInfoLog(fragment_shader, kErrorSize - 1, &len, log);
log[kErrorSize - 1] = 0;
LOG(FATAL) << log;
@@ -199,7 +199,7 @@ bool GlVideoRenderer::OnInitialize(media::VideoDecoder* decoder) {
glGetProgramiv(program, GL_LINK_STATUS, &result);
if (!result) {
char log[kErrorSize];
- int len;
+ int len = 0;
glGetProgramInfoLog(program, kErrorSize - 1, &len, log);
log[kErrorSize - 1] = 0;
LOG(FATAL) << log;
diff --git a/media/tools/player_x11/gles_video_renderer.cc b/media/tools/player_x11/gles_video_renderer.cc
index 8bd8b3e..104de5f 100644
--- a/media/tools/player_x11/gles_video_renderer.cc
+++ b/media/tools/player_x11/gles_video_renderer.cc
@@ -364,7 +364,7 @@ void GlesVideoRenderer::CreateShader(GLuint program,
glGetShaderiv(shader, GL_COMPILE_STATUS, &result);
if (!result) {
char log[kErrorSize];
- int len;
+ int len = 0;
glGetShaderInfoLog(shader, kErrorSize - 1, &len, log);
log[kErrorSize - 1] = 0;
LOG(FATAL) << log;
@@ -379,7 +379,7 @@ void GlesVideoRenderer::LinkProgram(GLuint program) {
glGetProgramiv(program, GL_LINK_STATUS, &result);
if (!result) {
char log[kErrorSize];
- int len;
+ int len = 0;
glGetProgramInfoLog(program, kErrorSize - 1, &len, log);
log[kErrorSize - 1] = 0;
LOG(FATAL) << log;