[vlc-commits] demux: libmp4: don't fail, just skip broken compressor name

Francois Cartegnie git at videolan.org
Wed Jan 21 17:30:31 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 21 17:29:21 2015 +0100| [18e445ad303c04d11cc84b0d4667aa11f5c2e829] | committer: Francois Cartegnie

demux: libmp4: don't fail, just skip broken compressor name

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

 modules/demux/mp4/libmp4.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 9a2cd1d..f949c31 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2135,10 +2135,13 @@ int MP4_ReadBox_sample_vide( stream_t *p_stream, MP4_Box_t *p_box )
     MP4_GET4BYTES( p_box->data.p_sample_vide->i_qt_data_size );
     MP4_GET2BYTES( p_box->data.p_sample_vide->i_qt_frame_count );
 
-    if ( i_read < 32 || p_peek[0] > 31 ) // Pascal String
+    if ( i_read < 32 )
         MP4_READBOX_EXIT( 0 );
-    memcpy( &p_box->data.p_sample_vide->sz_compressorname, &p_peek[1], p_peek[0] );
-    p_box->data.p_sample_vide->sz_compressorname[p_peek[0]] = 0;
+    if( p_peek[0] <= 31 ) // Must be Pascal String
+    {
+        memcpy( &p_box->data.p_sample_vide->sz_compressorname, &p_peek[1], p_peek[0] );
+        p_box->data.p_sample_vide->sz_compressorname[p_peek[0]] = 0;
+    }
     p_peek += 32; i_read -= 32;
 
     MP4_GET2BYTES( p_box->data.p_sample_vide->i_depth );



More information about the vlc-commits mailing list