From 4c9abdb7f2f33059a575abd55548b457bcad9fd8 Mon Sep 17 00:00:00 2001 From: "gman@chromium.org" Date: Tue, 7 Dec 2010 16:41:28 +0000 Subject: 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/5254006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68480 0039d316-1c4b-4281-b951-d872f2087c98 --- media/tools/player_x11/gl_video_renderer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'media/tools/player_x11/gl_video_renderer.cc') 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; -- cgit v1.1