vlc | branch: master | Francois Cartegnie <[email protected]> | 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 )

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to