[vlc-commits] demux: mp4: really exit on truncated data

Francois Cartegnie git at videolan.org
Tue Jan 9 12:38:48 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan  9 09:40:49 2018 +0100| [c808ce9510b808a06900d6e27565f8a5d3b7e302] | committer: Jean-Baptiste Kempf

demux: mp4: really exit on truncated data

(cherry picked from commit 068c9e7ddaca765ea4794cba911bac219b51cc73)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mp4/mp4.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 50778092f6..f3eff3e1b0 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -126,6 +126,7 @@ struct demux_sys_t
 #define DEMUX_TRACK_MAX_PRELOAD (CLOCK_FREQ * 15) /* maximum preloading, to deal with interleaving */
 
 #define VLC_DEMUXER_EOS (VLC_DEMUXER_EGENERIC - 1)
+#define VLC_DEMUXER_FATAL (VLC_DEMUXER_EGENERIC - 2)
 
 const uint32_t rgi_pict_atoms[2] = { ATOM_PICT, ATOM_pict };
 const char *psz_meta_roots[] = { "/moov/udta/meta/ilst",
@@ -4292,7 +4293,7 @@ static int FragDemuxTrack( demux_t *p_demux, mp4_track_t *p_track,
         {
             if( p_block )
                 block_Release( p_block );
-            return VLC_DEMUXER_EOF;
+            return VLC_DEMUXER_FATAL;
         }
 
 #if 0
@@ -4394,6 +4395,8 @@ static int DemuxMoof( demux_t *p_demux )
 
             if( i_ret == VLC_DEMUXER_SUCCESS )
                 i_status = VLC_DEMUXER_SUCCESS;
+            else if( i_ret == VLC_DEMUXER_FATAL )
+                i_status = VLC_DEMUXER_EOF;
         }
 
         if( i_status != VLC_DEMUXER_SUCCESS || !tk )



More information about the vlc-commits mailing list