[vlc-commits] mp4: use malloc() in SDTP box
Rémi Denis-Courmont
git at videolan.org
Fri Nov 24 20:54:51 CET 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 24 21:50:40 2017 +0200| [36fbebe3bbc18c8955922138ef005e748b573a36] | committer: Rémi Denis-Courmont
mp4: use malloc() in SDTP box
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=36fbebe3bbc18c8955922138ef005e748b573a36
---
modules/demux/mp4/libmp4.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index faef40eac0..4987588bd3 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -4066,9 +4066,8 @@ static int MP4_ReadBox_sdtp( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GETVERSIONFLAGS( p_box->data.p_sdtp );
i_sample_count = i_read;
- p_sdtp->p_sample_table = calloc( i_sample_count, 1 );
-
- if( !p_sdtp->p_sample_table )
+ p_sdtp->p_sample_table = malloc( i_sample_count );
+ if( unlikely(p_sdtp->p_sample_table == NULL) )
MP4_READBOX_EXIT( 0 );
for( uint32_t i = 0; i < i_sample_count; i++ )
More information about the vlc-commits
mailing list