Commit 739d192a authored by Gildas Bazin's avatar Gildas Bazin

* modules/services_discovery/sap.c, modules/codec/x264.c: fixed small mem leaks.

* modules/stream_out/transcode.c: fixed segfault.
parent 9aa2f5ea
......@@ -286,6 +286,7 @@ static int Open ( vlc_object_t *p_this )
p_sys->param.analyse.inter =
X264_ANALYSE_I4x4 | X264_ANALYSE_PSUB16x16 | X264_ANALYSE_PSUB8x8;
}
if( val.psz_string ) free( val.psz_string );
if( p_enc->fmt_in.video.i_aspect > 0 )
{
......
......@@ -365,11 +365,9 @@ static int OpenDemux( vlc_object_t *p_this )
uint8_t *p_peek;
int i_max_sdp = 1024;
int i_sdp = 0;
char *psz_sdp = (char *)malloc( i_max_sdp );
char *psz_sdp = NULL;
sdp_t *p_sdp = NULL;
if( !psz_sdp ) return VLC_EGENERIC;
/* Probe for SDP */
if( p_demux->s )
{
......@@ -383,6 +381,9 @@ static int OpenDemux( vlc_object_t *p_this )
}
}
psz_sdp = (char *)malloc( i_max_sdp );
if( !psz_sdp ) return VLC_EGENERIC;
/* Gather the complete sdp file */
for( ;; )
{
......@@ -424,7 +425,8 @@ static int OpenDemux( vlc_object_t *p_this )
{
p_sdp->psz_uri = NULL;
}
if( p_sdp->i_media_type != 33 && p_sdp->i_media_type != 32 && p_sdp->i_media_type != 14 )
if( p_sdp->i_media_type != 33 && p_sdp->i_media_type != 32 &&
p_sdp->i_media_type != 14 )
goto error;
if( p_sdp->psz_uri == NULL ) goto error;
......
......@@ -1490,9 +1490,9 @@ static int transcode_video_process( sout_stream_t *p_stream,
{
if( transcode_video_encoder_open( p_stream, id ) != VLC_SUCCESS )
{
p_pic->pf_release( p_pic );
transcode_video_close( p_stream, id );
id->b_transcode = VLC_FALSE;
p_pic->pf_release( p_pic );
return VLC_EGENERIC;
}
......@@ -1569,9 +1569,9 @@ static int transcode_video_process( sout_stream_t *p_stream,
vlc_object_detach( id->pp_filter[id->i_filter] );
vlc_object_destroy( id->pp_filter[id->i_filter] );
p_pic->pf_release( p_pic );
transcode_video_close( p_stream, id );
id->b_transcode = VLC_FALSE;
p_pic->pf_release( p_pic );
return VLC_EGENERIC;
}
}
......
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