[vlc-devel] commit: TS demux: fix memory leak using ACCESS_SET_PRIVATE_ID_CA ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sat Nov 28 11:15:06 CET 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 28 12:13:38 2009 +0200| [21edd87a49e595ec1de3756e95b8e22f1322cea1] | committer: Rémi Denis-Courmont
TS demux: fix memory leak using ACCESS_SET_PRIVATE_ID_CA
If the access does not support CAM, we need to free the PMT
(closes #3163)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21edd87a49e595ec1de3756e95b8e22f1322cea1
---
modules/access/bda/bda.c | 2 +-
modules/demux/ts.c | 13 ++++---------
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/modules/access/bda/bda.c b/modules/access/bda/bda.c
index a063c42..5db2322 100644
--- a/modules/access/bda/bda.c
+++ b/modules/access/bda/bda.c
@@ -577,7 +577,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
b_bool = (bool)va_arg( args, int );
break;
case ACCESS_SET_PRIVATE_ID_CA: /* 12 -From Demux */
- break;
+ return VLC_EGENERIC;
default:
msg_Warn( p_access,
"DVB_Control: Unimplemented query in control %d", i_query );
diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index b71355f..1a51259 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -4133,16 +4133,11 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
}
}
- if( ProgramIsSelected( p_demux, prg->i_number ) )
- {
- /* Set CAM descrambling */
- stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
- ACCESS_SET_PRIVATE_ID_CA, p_pmt );
- }
- else
- {
+ /* Set CAM descrambling */
+ if( !ProgramIsSelected( p_demux, prg->i_number )
+ || stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
+ ACCESS_SET_PRIVATE_ID_CA, p_pmt ) != VLC_SUCCESS )
dvbpsi_DeletePMT( p_pmt );
- }
for( int i = 0; i < i_clean; i++ )
{
More information about the vlc-devel
mailing list