[vlc-commits] demux: mp4: fix memleak on error

Francois Cartegnie git at videolan.org
Sat Mar 7 19:06:26 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Mar  7 19:00:59 2015 +0100| [8f0ad2f30f7de6b8e9b10f372c2a9e49b4a35d25] | committer: Francois Cartegnie

demux: mp4: fix memleak on error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8f0ad2f30f7de6b8e9b10f372c2a9e49b4a35d25
---

 modules/demux/mp4/mp4.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 21ad874..09666fb 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3632,7 +3632,11 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
     ret->p_sample_delta_dts = calloc( ret->i_sample_count, sizeof( uint32_t ) );
 
     if( !ret->p_sample_count_dts || !ret->p_sample_delta_dts )
+    {
+        free( ret->p_sample_count_dts );
+        free( ret->p_sample_delta_dts );
         return VLC_ENOMEM;
+    }
 
     ret->p_sample_count_pts = calloc( ret->i_sample_count, sizeof( uint32_t ) );
     if( !ret->p_sample_count_pts )



More information about the vlc-commits mailing list