[vlc-commits] demux: mp4: fix potential NULL deref

Francois Cartegnie git at videolan.org
Tue Feb 5 15:10:48 CET 2019


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jan 24 18:42:36 2019 +0100| [17cba73e5419adeed80a35a58f187bf754866778] | committer: Francois Cartegnie

demux: mp4: fix potential NULL deref

TrackGotoChunkSample changes p_es

(cherry picked from commit a308f54b23519c1648975cfce8edb3f1addb6db3)

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

 modules/demux/mp4/mp4.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index ccb4810318..5912b3a0d5 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -1251,8 +1251,9 @@ static int DemuxTrack( demux_t *p_demux, mp4_track_t *tk, uint64_t i_readpos,
         }
 
         /* Next sample */
-        if ( i_nb_samples ) /* sample size could be 0, need to go fwd. see return */
-            MP4_TrackNextSample( p_demux, tk, i_nb_samples );
+        if ( i_nb_samples && /* sample size could be 0, need to go fwd. see return */
+             MP4_TrackNextSample( p_demux, tk, i_nb_samples ) )
+            goto end;
 
         uint32_t i_next_run_seq = MP4_TrackGetRunSeq( tk );
         if( i_next_run_seq != i_run_seq )



More information about the vlc-commits mailing list