[vlc-commits] [Git][videolan/vlc][master] demux: mp4: fix reading vpcC box

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Nov 18 09:13:31 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
b08e1792 by Marvin Scholz at 2021-11-18T08:58:47+00:00
demux: mp4: fix reading vpcC box

The VP Codec ISO Media File Format Binding specification
states that the VP codec configuration box (vpcC) extends the
FullBox and a FullBox starts with a 1 byte version followed by
3 bytes flags.

Even though we are not interested in the flags, we still have to
read them, else all following reads will read from the wrong position,
resulting in, among other things, bogus values in the i_codec_init_datasize
which is supposed to be always 0 for VP8 and VP9.

- - - - -


1 changed file:

- modules/demux/mp4/libmp4.c


Changes:

=====================================
modules/demux/mp4/libmp4.c
=====================================
@@ -1911,13 +1911,18 @@ static int MP4_ReadBox_vpcC( stream_t *p_stream, MP4_Box_t *p_box )
     MP4_READBOX_ENTER( MP4_Box_data_vpcC_t, MP4_FreeBox_vpcC );
     MP4_Box_data_vpcC_t *p_vpcC = p_box->data.p_vpcC;
 
-    if( p_box->i_size < 6 )
+    if( p_box->i_size < 9 )
         MP4_READBOX_EXIT( 0 );
 
     MP4_GET1BYTE( p_vpcC->i_version );
     if( p_vpcC->i_version > 1 )
         MP4_READBOX_EXIT( 0 );
 
+    /* Skip flags */
+    uint32_t i_flags;
+    MP4_GET3BYTES( i_flags );
+    VLC_UNUSED( i_flags );
+
     MP4_GET1BYTE( p_vpcC->i_profile );
     MP4_GET1BYTE( p_vpcC->i_level );
     MP4_GET1BYTE( p_vpcC->i_bit_depth );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b08e179241c3e6f5fc0253731e9272a9e67ae066

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b08e179241c3e6f5fc0253731e9272a9e67ae066
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list