Commit e59154b3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vaapi: fix some memory leaks

parent d8c0c2fc
/***************************************************************************** /*****************************************************************************
* vaapi.c: VAAPI helpers for the libavcodec decoder * vaapi.c: VAAPI helpers for the libavcodec decoder
***************************************************************************** *****************************************************************************
* Copyright (C) 2009 Laurent Aimar * Copyright (C) 2009-2010 Laurent Aimar
* $Id$ * Copyright (C) 2012-2014 Rémi Denis-Courmont
* *
* Authors: Laurent Aimar <fenrir_AT_ videolan _DOT_ org> * Authors: Laurent Aimar <fenrir_AT_ videolan _DOT_ org>
* *
...@@ -218,7 +218,11 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count ) ...@@ -218,7 +218,11 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count )
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
#warning Leaks! if( sys->p_display != NULL )
vaTerminate( sys->p_display );
if( sys->p_display_x11 != NULL )
XCloseDisplay( sys->p_display_x11 );
free( sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -527,9 +531,7 @@ static void Close( vlc_va_sys_t *sys ) ...@@ -527,9 +531,7 @@ static void Close( vlc_va_sys_t *sys )
if( sys->i_config_id != VA_INVALID_ID ) if( sys->i_config_id != VA_INVALID_ID )
vaDestroyConfig( sys->p_display, sys->i_config_id ); vaDestroyConfig( sys->p_display, sys->i_config_id );
if( sys->p_display )
vaTerminate( sys->p_display ); vaTerminate( sys->p_display );
if( sys->p_display_x11 )
XCloseDisplay( sys->p_display_x11 ); XCloseDisplay( sys->p_display_x11 );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment