[vlc-commits] demux: mp4: meta != udta/meta
Francois Cartegnie
git at videolan.org
Sun Apr 13 11:49:51 CEST 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Apr 13 11:33:19 2014 +0200| [34d9105ebd2a2773105465b41392e1fa591f9ac6] | committer: Francois Cartegnie
demux: mp4: meta != udta/meta
stop trying to read random atoms
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=34d9105ebd2a2773105465b41392e1fa591f9ac6
---
modules/demux/mp4/libmp4.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index fe94da0..e4839f4 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2854,13 +2854,33 @@ static int MP4_ReadBox_meta( stream_t *p_stream, MP4_Box_t *p_box )
if( i_actually_read < 8 )
return 0;
- /* meta content starts with a 4 byte version/flags value (should be 0) */
- i_actually_read = stream_Read( p_stream, meta_data, 4 );
- if( i_actually_read < 4 )
+ if ( !p_box->p_father )
return 0;
- /* then it behaves like a container */
- return MP4_ReadBoxContainerRaw( p_stream, p_box );
+ switch( p_box->p_father->i_type )
+ {
+ case ATOM_udta: /* itunes udta/meta */
+ /* meta content starts with a 4 byte version/flags value (should be 0) */
+ i_actually_read = stream_Read( p_stream, meta_data, 4 );
+ if( i_actually_read < 4 )
+ return 0;
+
+ /* then it behaves like a container */
+ return MP4_ReadBoxContainerRaw( p_stream, p_box );
+
+ default: /* regular meta atom */
+
+ i_actually_read = stream_Read( p_stream, meta_data, 8 );
+ if( i_actually_read < 8 )
+ return 0;
+
+ /* Mandatory */
+ if ( VLC_FOURCC( meta_data[4], meta_data[5], meta_data[6], meta_data[7] ) != ATOM_hdlr )
+ return 0;
+
+ //ft
+ }
+ return 1;
}
static int MP4_ReadBox_iods( stream_t *p_stream, MP4_Box_t *p_box )
More information about the vlc-commits
mailing list