[vlc-commits] demux: mp4: do stsd v2 checks
Francois Cartegnie
git at videolan.org
Thu Jun 5 20:32:20 CEST 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jun 4 16:47:24 2014 +0200| [36bdc4add90d04e90a168d0fd011c42369a297a1] | committer: Francois Cartegnie
demux: mp4: do stsd v2 checks
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=36bdc4add90d04e90a168d0fd011c42369a297a1
---
modules/demux/mp4/libmp4.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 8685697..8996cd7 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -1668,6 +1668,19 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
int64_t dummy;
uint32_t i_channel;
+ /* Checks */
+ if ( p_box->data.p_sample_soun->i_channelcount != 0x3 ||
+ p_box->data.p_sample_soun->i_samplesize != 0x0010 ||
+ p_box->data.p_sample_soun->i_predefined != 0xFFFE ||
+ p_box->data.p_sample_soun->i_reserved3 != 0x0 ||
+ p_box->data.p_sample_soun->i_sampleratehi != 0x1 ||//65536
+ p_box->data.p_sample_soun->i_sampleratelo != 0x0 ) //remainder
+ {
+ msg_Err( p_stream, "invalid stsd V2 box" );
+ MP4_READBOX_EXIT( 0 );
+ }
+ /* !Checks */
+
MP4_GET4BYTES( p_box->data.p_sample_soun->i_sample_per_packet );
MP4_GET8BYTES( dummy );
memcpy( &f_sample_rate, &dummy, 8 );
More information about the vlc-commits
mailing list