[vlc-commits] [Git][videolan/vlc][3.0.x] demux: mp4: fix reading vpcC box

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Sat Nov 20 09:20:38 UTC 2021



Hugo Beauzée-Luyssen pushed to branch 3.0.x at VideoLAN / VLC


Commits:
d616f01f by Marvin Scholz at 2021-11-19T09:24:49+01: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.

(cherry picked from commit b08e179241c3e6f5fc0253731e9272a9e67ae066)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

- - - - -


1 changed file:

- modules/demux/mp4/libmp4.c


Changes:

=====================================
modules/demux/mp4/libmp4.c
=====================================
@@ -2008,13 +2008,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/d616f01fa9c735b0def82fbfcf10d46d04ef9acf

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




More information about the vlc-commits mailing list