summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authoriive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-11-15 14:56:18 +0000
committeriive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-11-15 14:56:18 +0000
commitb3dcfc7ec68bfd1e6e5333fe784e3c8676a0734e (patch)
treea650da39fcceb6ddd0b6acc81b0661bbb574541c /libvo
parentd4f6145e8978c424cfc57516b023671e328d731f (diff)
downloadmpv-b3dcfc7ec68bfd1e6e5333fe784e3c8676a0734e.tar.bz2
mpv-b3dcfc7ec68bfd1e6e5333fe784e3c8676a0734e.tar.xz
3 memory leaks fixed
Xlib funtions allocate memory that should be freed appropriately git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13954 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_xv.c9
-rw-r--r--libvo/x11_common.c1
2 files changed, 8 insertions, 2 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 6e7f4a2e64..1b1c7746b8 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -68,7 +68,7 @@ static void allocate_xvimage(int);
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 @@ static void uninit(void)
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 @@ static uint32_t preinit(const char *arg)
{
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 @@ static uint32_t preinit(const char *arg)
XvSetPortAttribute(mDisplay, xv_port, autopaint, 1);
break;
}
+ XFree(attributes);
}
fo = XvListImageFormats(mDisplay, xv_port, (int *) &formats);
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 4399b8d3c6..f442b9639c 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -178,6 +178,7 @@ void vo_hidecursor(Display * disp, Window win)
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)