[vlc-commits] mux: ogg: kill out of bound access warning for contenttypeless codecs.

Francois Cartegnie git at videolan.org
Wed Mar 12 17:44:21 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Mar 12 17:41:43 2014 +0100| [577f6f28932c10adc91117226cdfb773f22fcc16] | committer: Francois Cartegnie

mux: ogg: kill out of bound access warning for contenttypeless codecs.

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

 modules/mux/ogg.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c
index d91418c..02b844f 100644
--- a/modules/mux/ogg.c
+++ b/modules/mux/ogg.c
@@ -837,12 +837,14 @@ static void OggGetSkeletonFisbone( uint8_t **pp_buffer, long *pi_size,
     if ( p_input->p_fmt->p_extra )
         SetDWLE( &(*pp_buffer)[44], xiph_CountHeaders( p_input->p_fmt->p_extra, p_input->p_fmt->i_extra ) );
 
-    psz_header = *pp_buffer + FISBONE_BASE_SIZE;
-    memcpy( psz_header, headers.psz_content_type, strlen( headers.psz_content_type ) );
-    psz_header += strlen( headers.psz_content_type );
-    if ( headers.psz_role )
-        memcpy( psz_header, headers.psz_role, strlen( headers.psz_role ) );
-
+    if ( headers.i_size > 0 )
+    {
+        psz_header = *pp_buffer + FISBONE_BASE_SIZE;
+        memcpy( psz_header, headers.psz_content_type, strlen( headers.psz_content_type ) );
+        psz_header += strlen( headers.psz_content_type );
+        if ( headers.psz_role )
+            memcpy( psz_header, headers.psz_role, strlen( headers.psz_role ) );
+    }
     *pi_size = FISBONE_BASE_SIZE + headers.i_size;
 
     free( headers.psz_content_type );



More information about the vlc-commits mailing list