[vlc-commits] demux/mp4: adjust to changes introduced by 8f9b76e

Filip Roséen git at videolan.org
Tue Nov 22 20:38:15 CET 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Thu Nov 17 05:21:09 2016 +0100| [c19f472ff08ec446dba680e47dd66b2880215d81] | committer: Francois Cartegnie

demux/mp4: adjust to changes introduced by 8f9b76e

ExtractIntlStrings is only applicable for a limited range of boxes,
though with the recent changes following its introduction it might be
invoked for entities it is currently not protected from misdiagnosing.

These changes make sure that we only interpret a box inside the
function if:

 - the atom is known as a metadata box
 - the box has been parsed
 - the box has a father, and it is ATOM_udta

The check so that we do not parse boxes that contain a "data"-box has
been removed given that this check is more suitable at where the call
to the function is made.

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c19f472ff08ec446dba680e47dd66b2880215d81
---

 modules/demux/mp4/meta.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mp4/meta.c b/modules/demux/mp4/meta.c
index b3553d7..f29200e 100644
--- a/modules/demux/mp4/meta.c
+++ b/modules/demux/mp4/meta.c
@@ -241,10 +241,7 @@ static bool SetMeta( vlc_meta_t* p_meta, int i_type, char const* name, MP4_Box_t
 
 static int ExtractIntlStrings( vlc_meta_t *p_meta, MP4_Box_t *p_box )
 {
-    if( *(uint8_t*)&p_box->i_type != 0xa9 || MP4_BoxGet( p_box, "data" ) )
-        return false;
-
-    if( p_box->data.p_binary->p_blob == NULL )
+    if( MP4_BoxGet( p_box, "data" ) )
         return false;
 
     vlc_meta_type_t const* meta_type;
@@ -253,6 +250,14 @@ static int ExtractIntlStrings( vlc_meta_t *p_meta, MP4_Box_t *p_box )
     if( AtomXA9ToMeta( p_box->i_type, &meta_type, &meta_key ) == false )
         return false;
 
+    if( p_box->p_father == NULL              ||
+        p_box->p_father->i_type != ATOM_udta ||
+        p_box->data.p_binary == NULL         ||
+        p_box->data.p_binary->p_blob == NULL )
+    {
+        return false;
+    }
+
     vlc_meta_t* p_meta_intl = vlc_meta_New();
 
     if( unlikely( !p_meta_intl ) )



More information about the vlc-commits mailing list