[vlc-devel] [PATCH 3/5] demux/mp4: make sure we have enough data remaining in ExtractIntlStrings

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


The previous implementation would assume that we would always have at
least 4 bytes of data left in the pending buffer, which can cause us
to read more bytes than available inside the loop.

This change make sure that we do not continue parsing if this happens.
---
 modules/demux/mp4/meta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mp4/meta.c b/modules/demux/mp4/meta.c
index a7f5764..73a78b4 100644
--- a/modules/demux/mp4/meta.c
+++ b/modules/demux/mp4/meta.c
@@ -264,7 +264,7 @@ static int ExtractIntlStrings( vlc_meta_t *p_meta, MP4_Box_t *p_box )
     char const* p_peek = p_box->data.p_binary->p_blob;
     uint64_t i_read = p_box->data.p_binary->i_blob;
 
-    while( i_read )
+    while( i_read >= 4 )
     {
         uint16_t i_len, i_lang;
 
-- 
2.10.2



More information about the vlc-devel mailing list