[vlc-devel] [PATCH 4/5] demux/mp4: ExtractIntlStrings: do not continue on encoding failure

Filip Roséen filip at atch.se
Thu Nov 17 05:21:12 CET 2016


If the data that is stated to be in one encoding is actually not, we
should not continue parsing. The introduced check make sure that we
abort parsing if this happens (because the data cannot be trusted,
which is most likely due to the field inaccurately being flagged as
containing intl-metadata).
---
 modules/demux/mp4/meta.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/demux/mp4/meta.c b/modules/demux/mp4/meta.c
index 73a78b4..c310c34 100644
--- a/modules/demux/mp4/meta.c
+++ b/modules/demux/mp4/meta.c
@@ -285,6 +285,10 @@ static int ExtractIntlStrings( vlc_meta_t *p_meta, MP4_Box_t *p_box )
         }
 
         char* data = FromCharset( charset, p_peek, i_len );
+
+        if( data == NULL )
+            break;
+
         if( meta_type )
         {
             vlc_meta_Set( p_meta_intl, *meta_type, data );
-- 
2.10.2



More information about the vlc-devel mailing list