[Mplayer-cvslog] CVS: main/libvo vo_gl2.c,1.51,1.52

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sun Oct 3 23:42:34 CEST 2004


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv7714/libvo

Modified Files:
	vo_gl2.c 
Log Message:
fixed memleak, especially for fixed-vo.
Based on a patch by beastd (eclipse7 (at) gmx (dot) net).


Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- vo_gl2.c	25 Jul 2004 12:49:01 -0000	1.51
+++ vo_gl2.c	3 Oct 2004 21:42:31 -0000	1.52
@@ -88,7 +88,7 @@
 static uint32_t texture_height;
 static int texnumx, texnumy, raw_line_len;
 static GLfloat texpercx, texpercy;
-static struct TexSquare * texgrid;
+static struct TexSquare * texgrid = NULL;
 static GLint    gl_internal_format;
 static char *   gl_internal_format_s;
 static int      rgb_sz, r_sz, g_sz, b_sz, a_sz;
@@ -212,6 +212,8 @@
   if (texpercy > 1.0)
     texpercy = 1.0;
 
+  if (texgrid)
+    free(texgrid);
   texgrid = (struct TexSquare *)
     calloc (texnumx * texnumy, sizeof (struct TexSquare));
 
@@ -1176,6 +1178,10 @@
 uninit(void)
 {
   if ( !vo_config_count ) return;
+  if (texgrid) {
+    free(texgrid);
+    texgrid = NULL;
+  }
 #ifdef GL_WIN32
   vo_w32_uninit();
 #else




More information about the MPlayer-cvslog mailing list