[vlc-commits] demux: mp4: rtpsetup: add missing checks on tims

Francois Cartegnie git at videolan.org
Sat May 21 17:05:35 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat May 21 15:21:00 2016 +0200| [baa16057c7bb8742c4d832b7c16617fe986fff3f] | committer: Francois Cartegnie

demux: mp4: rtpsetup: add missing checks on tims

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

 modules/demux/mp4/essetup.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index b58ef1e..4e2592e 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -271,14 +271,16 @@ static int SetupRTPReceptionHintTrack( demux_t *p_demux, mp4_track_t *p_track, M
         pch = strtok_r(NULL, " =\n", &strtok_state); /* next attribute */
     }
 
-    MP4_Box_t *p_tims_box = MP4_BoxGet(p_sample, "tims", 0);
-    if( p_tims_box != NULL )
+    const MP4_Box_t *p_tims = MP4_BoxGet(p_sample, "tims");
+    if( p_tims && BOXDATA(p_tims) && BOXDATA(p_tims)->i_timescale )
     {
-        MP4_Box_data_tims_t *p_tims = p_tims_box->data.p_tims;
-        p_track->i_timescale = p_tims->i_timescale;
+        p_track->i_timescale = BOXDATA(p_tims)->i_timescale;
     }
     else
+    {
         msg_Warn(p_demux, "Missing mandatory box tims");
+        return 0;
+    }
 
     MP4_Box_t *p_tssy_box = MP4_BoxGet(p_sample, "tssy", 0);
     if( p_tssy_box != NULL )



More information about the vlc-commits mailing list