[vlc-commits] demux: libmp4: fix heap buffer write ofw in chpl (fix #12366)

Francois Cartegnie git at videolan.org
Thu Oct 9 14:53:45 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct  9 14:44:36 2014 +0200| [d1bdd44b1902f62453f6982e1ee09a5b243f25ee] | committer: Francois Cartegnie

demux: libmp4: fix heap buffer write ofw in chpl (fix #12366)

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

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

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 3538fad..f0e4e73 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -3005,6 +3005,8 @@ static int MP4_ReadBox_chpl( stream_t *p_stream, MP4_Box_t *p_box )
         uint64_t i_start;
         uint8_t i_len;
         int i_copy;
+        if ( i_read < 9 )
+            break;
         MP4_GET8BYTES( i_start );
         MP4_GET1BYTE( i_len );
 
@@ -3021,6 +3023,10 @@ static int MP4_ReadBox_chpl( stream_t *p_stream, MP4_Box_t *p_box )
         p_peek += i_copy;
         i_read -= i_copy;
     }
+
+    if ( i != p_chpl->i_chapter )
+        p_chpl->i_chapter = i;
+
     /* Bubble sort by increasing start date */
     do
     {



More information about the vlc-commits mailing list