summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2011-12-15 23:29:50 +0200
committerPetri Hintukainen <phintuka@users.sourceforge.net>2011-12-15 23:29:50 +0200
commit556e616af4d6b97a40e5b4a1d0dbf56a956b6a3c (patch)
tree8dc4b76ad50c268900c72587035c7e9e30df8c81
parentfc97fb46d693697ef65f008f7a38a3797599e4cb (diff)
downloadxine-lib-556e616af4d6b97a40e5b4a1d0dbf56a956b6a3c.tar.gz
xine-lib-556e616af4d6b97a40e5b4a1d0dbf56a956b6a3c.tar.bz2
xvmc: Fixed using uninitialized data and resource leak (from 9456)
--HG-- branch : point-release
-rw-r--r--src/video_out/video_out_xvmc.c12
1 files 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;