From 556e616af4d6b97a40e5b4a1d0dbf56a956b6a3c Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Thu, 15 Dec 2011 23:29:50 +0200 Subject: xvmc: Fixed using uninitialized data and resource leak (from 9456) --HG-- branch : point-release --- src/video_out/video_out_xvmc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 16d87c6b0..f06f0cf3f 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -226,6 +226,8 @@ typedef struct { Display *display; config_values_t *config; XvPortID xv_port; + XvAdaptorInfo *adaptor_info; + unsigned int adaptor_num; int surface_type_id; unsigned int max_surface_width; @@ -1345,8 +1347,8 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi int nattr; x11_visual_t *visual = (x11_visual_t *) visual_gen; XColor dummy; - XvAdaptorInfo *adaptor_info; - unsigned int adaptor_num; + XvAdaptorInfo *adaptor_info = class->adaptor_info; + unsigned int adaptor_num = class->adaptor_num; /* XvImage *myimage; */ lprintf ("open_plugin\n"); @@ -1611,6 +1613,10 @@ static char* get_description (video_driver_class_t *this_gen) { static void dispose_class (video_driver_class_t *this_gen) { xvmc_class_t *this = (xvmc_class_t *) this_gen; + XLockDisplay(this->display); + XvFreeAdaptorInfo (this->adaptor_info); + XUnlockDisplay(this->display); + free (this); } @@ -1783,6 +1789,8 @@ static void *init_class (xine_t *xine, void *visual_gen) { this->display = display; this->config = xine->config; this->xv_port = xv_port; + this->adaptor_info = adaptor_info; + this->adaptor_num = adaptor_num; this->surface_type_id = surface_type; this->max_surface_width = max_width; this->max_surface_height = max_height; -- cgit v1.2.3