changeset 36222:5bff1fc3e7e5

vo_gl_tiled: ensure variables are always initialized. This applies in particular if the backend isn't X11 or W32.
author reimar
date Sun, 09 Jun 2013 18:33:24 +0000
parents e597260febad
children 95be7d60ca9b
files libvo/vo_gl_tiled.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl_tiled.c	Sun Jun 09 18:33:23 2013 +0000
+++ b/libvo/vo_gl_tiled.c	Sun Jun 09 18:33:24 2013 +0000
@@ -102,6 +102,7 @@
 
 static GLint getInternalFormat(void)
 {
+  r_sz = g_sz = b_sz = a_sz = 0;
   switch (glctx.type) {
 #ifdef CONFIG_GL_WIN32
   case GLTYPE_W32:
@@ -109,9 +110,7 @@
   PIXELFORMATDESCRIPTOR pfd;
   HDC vo_hdc = vo_w32_get_dc(vo_w32_window);
   int pf = GetPixelFormat(vo_hdc);
-  if (!DescribePixelFormat(vo_hdc, pf, sizeof pfd, &pfd)) {
-    r_sz = g_sz = b_sz = a_sz = 0;
-  } else {
+  if (DescribePixelFormat(vo_hdc, pf, sizeof pfd, &pfd)) {
     r_sz = pfd.cRedBits;
     g_sz = pfd.cGreenBits;
     b_sz = pfd.cBlueBits;