[MPlayer-cvslog] CVS: main/libvo vo_xv.c, 1.157, 1.158 x11_common.c, 1.182, 1.183

Ivan Kalvachev CVS syncmail at mplayerhq.hu
Mon Nov 15 15:56:20 CET 2004


CVS change done by Ivan Kalvachev CVS

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

Modified Files:
	vo_xv.c x11_common.c 
Log Message:
3 memory leaks fixed
Xlib funtions allocate memory that should be freed appropriately


Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -r1.157 -r1.158
--- vo_xv.c	11 Nov 2004 02:24:23 -0000	1.157
+++ vo_xv.c	15 Nov 2004 14:56:18 -0000	1.158
@@ -68,7 +68,7 @@
 static unsigned int ver, rel, req, ev, err;
 static unsigned int formats, adaptors, xv_port, xv_format;
 static XvAdaptorInfo *ai = NULL;
-static XvImageFormatValues *fo;
+static XvImageFormatValues *fo=NULL;
 
 static int current_buf = 0;
 static int current_ip_buf = 0;
@@ -761,6 +761,10 @@
         return;
     XvFreeAdaptorInfo(ai);
     ai = NULL;
+    if(fo){
+        XFree(fo);
+        fo=NULL;
+    }
     for (i = 0; i < num_buffers; i++)
         deallocate_xvimage(i);
 #ifdef HAVE_XF86VM
@@ -878,7 +882,7 @@
 
     {
         int howmany, i;
-        const XvAttribute *const attributes =
+        XvAttribute * const attributes =
             XvQueryPortAttributes(mDisplay, xv_port, &howmany);
 
         for (i = 0; i < howmany && attributes; i++)
@@ -889,6 +893,7 @@
                 XvSetPortAttribute(mDisplay, xv_port, autopaint, 1);
                 break;
             }
+	XFree(attributes);
     }
 
     fo = XvListImageFormats(mDisplay, xv_port, (int *) &formats);

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -r1.182 -r1.183
--- x11_common.c	15 Nov 2004 09:09:29 -0000	1.182
+++ x11_common.c	15 Nov 2004 14:56:18 -0000	1.183
@@ -178,6 +178,7 @@
     XFreeCursor(disp, no_ptr);
     if (bm_no != None)
         XFreePixmap(disp, bm_no);
+    XFreeColors(disp,colormap,&black.pixel,1,0);
 }
 
 void vo_showcursor(Display * disp, Window win)




More information about the MPlayer-cvslog mailing list