[vlc-commits] mux: mp4: fix truncated text sample description

Francois Cartegnie git at videolan.org
Wed Jan 17 20:28:06 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 17 20:19:31 2018 +0100| [e4e7134c24747e5356ec68bc201e9dcc69a02970] | committer: Francois Cartegnie

mux: mp4: fix truncated text sample description

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

 modules/mux/mp4/libmp4mux.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index 015d0772b5..c465703921 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -1030,6 +1030,11 @@ static bo_t *GetTextBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
         if(!text)
             return NULL;
 
+        /* Sample Entry Header */
+        for (int i = 0; i < 6; i++)
+            bo_add_8(text, 0);        // reserved;
+        bo_add_16be(text, 1);         // data-reference-index
+
         if(p_track->fmt.i_extra >= 44)
         {
             /* Copy the original sample description format */
@@ -1069,6 +1074,11 @@ static bo_t *GetTextBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
         if(!tx3g)
             return NULL;
 
+        /* Sample Entry Header */
+        for (int i = 0; i < 6; i++)
+            bo_add_8(tx3g, 0);        // reserved;
+        bo_add_16be(tx3g, 1);         // data-reference-index
+
         if(p_track->fmt.i_codec == VLC_CODEC_TX3G &&
            p_track->fmt.i_extra >= 32)
         {
@@ -1077,11 +1087,6 @@ static bo_t *GetTextBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
         }
         else /* Build TTXT(tx3g) sample desc */
         {
-            /* Sample Entry Header */
-            for (int i = 0; i < 6; i++)
-                bo_add_8(tx3g, 0);        // reserved;
-            bo_add_16be(tx3g, 1);         // data-reference-index
-
             /* tx3g sample description */
             bo_add_32be(tx3g, 0);         // display flags
             bo_add_16be(tx3g, 0);         // justification



More information about the vlc-commits mailing list