[vlc-commits] demux: libmp4: fix reading SmDm/CoLL
Francois Cartegnie
git at videolan.org
Tue Aug 21 20:03:03 CEST 2018
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Aug 21 18:57:26 2018 +0200| [f8e1f144e40a7b6d6c7fda7d443ef6ef081bb027] | committer: Francois Cartegnie
demux: libmp4: fix reading SmDm/CoLL
(cherry picked from commit 3e2d5c34e5f797aa6bc2f9fdfac61ab21cd1849f)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f8e1f144e40a7b6d6c7fda7d443ef6ef081bb027
---
modules/demux/mp4/libmp4.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 842581f37e..b71abf8739 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -1998,8 +1998,17 @@ static int MP4_ReadBox_SmDm( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_ENTER( MP4_Box_data_SmDm_t, NULL );
MP4_Box_data_SmDm_t *p_SmDm = p_box->data.p_SmDm;
+ uint8_t i_version;
+ uint32_t i_flags;
+ MP4_GET1BYTE( i_version );
+ MP4_GET3BYTES( i_flags );
+ VLC_UNUSED(i_flags);
+ if( i_version != 0 )
+ MP4_READBOX_EXIT( 0 );
+
+ const uint8_t RGB2GBR[3] = {2,0,1};
for(int i=0; i<6; i++)
- MP4_GET2BYTES( p_SmDm->primaries[i] );
+ MP4_GET2BYTES( p_SmDm->primaries[RGB2GBR[i/2] + i%2] );
for(int i=0; i<2; i++)
MP4_GET2BYTES( p_SmDm->white_point[i] );
MP4_GET4BYTES( p_SmDm->i_luminanceMax );
@@ -2012,6 +2021,15 @@ static int MP4_ReadBox_CoLL( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_READBOX_ENTER( MP4_Box_data_CoLL_t, NULL );
MP4_Box_data_CoLL_t *p_CoLL = p_box->data.p_CoLL;
+
+ uint8_t i_version;
+ uint32_t i_flags;
+ MP4_GET1BYTE( i_version );
+ MP4_GET3BYTES( i_flags );
+ VLC_UNUSED(i_flags);
+ if( i_version != 0 )
+ MP4_READBOX_EXIT( 0 );
+
MP4_GET2BYTES( p_CoLL->i_maxCLL );
MP4_GET2BYTES( p_CoLL->i_maxFALL );
MP4_READBOX_EXIT( 1 );
More information about the vlc-commits
mailing list