vlc | branch: master | Rémi Duraffort <[email protected]> | Sat Apr 7 18:07:46 2012 +0200| [d2a4fbf984cb832e54aea0cc5e2f6d5d6732a0bd] | committer: Rémi Duraffort
real: fix potential memory leak. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d2a4fbf984cb832e54aea0cc5e2f6d5d6732a0bd --- modules/demux/real.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/modules/demux/real.c b/modules/demux/real.c index df1a0ad..06f9f3a 100644 --- a/modules/demux/real.c +++ b/modules/demux/real.c @@ -1567,7 +1567,10 @@ static int CodecAudioParse( demux_t *p_demux, int i_tk_id, const uint8_t *p_data { fmt.p_extra = malloc( i_extra_codec ); if( !fmt.p_extra || i_extra_codec > i_data ) + { + free( fmt.p_extra ); return VLC_ENOMEM; + } fmt.i_extra = i_extra_codec; memcpy( fmt.p_extra, p_data, fmt.i_extra ); @@ -1606,7 +1609,10 @@ static int CodecAudioParse( demux_t *p_demux, int i_tk_id, const uint8_t *p_data { fmt.p_extra = malloc( i_extra_codec ); if( !fmt.p_extra || i_extra_codec > i_data ) + { + free( fmt.p_extra ); return VLC_ENOMEM; + } fmt.i_extra = i_extra_codec; memcpy( fmt.p_extra, p_data, fmt.i_extra ); _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
