[vlc-commits] demux: mp4: reject old MPEG-PS
Francois Cartegnie
git at videolan.org
Thu Apr 16 15:50:54 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 16 10:32:42 2020 +0200| [aa2939c19db6906c306680daef67e93781009d21] | committer: Francois Cartegnie
demux: mp4: reject old MPEG-PS
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa2939c19db6906c306680daef67e93781009d21
---
modules/demux/mp4/libmp4.h | 5 +++++
modules/demux/mp4/mp4.c | 19 +++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index cf9629382b..7318ee8898 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -446,6 +446,11 @@ typedef int64_t stime_t;
#define ATOM_mpod VLC_FOURCC( 'm', 'p', 'o', 'd' )
#define ATOM_cdsc VLC_FOURCC( 'c', 'd', 's', 'c' )
+/* mpeg or mpeg PS m1v, m1s */
+#define HANDLER_m1v VLC_FOURCC('m', '1', 'v', ' ')
+#define HANDLER_m1s VLC_FOURCC('m', '1', 's', ' ')
+#define HANDLER_mpeg VLC_FOURCC('M', 'P', 'E', 'G')
+
/* HEIF Specific */
#define HANDLER_pict VLC_FOURCC('p', 'i', 'c', 't')
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 9d577ace8b..8e6a59d4d3 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -989,6 +989,25 @@ static int Open( vlc_object_t * p_this )
}
msg_Dbg( p_demux, "found %u track%c", i_tracks, i_tracks ? 's':' ' );
+ /* reject old monolithically embedded mpeg */
+ if( i_tracks == 1 )
+ {
+ const MP4_Box_t *p_hdlr = MP4_BoxGet( p_sys->p_root, "/moov/trak/mdia/hdlr" );
+ if( p_hdlr && BOXDATA(p_hdlr) )
+ {
+ switch( BOXDATA(p_hdlr)->i_handler_type )
+ {
+ case HANDLER_m1v:
+ case HANDLER_m1s:
+ case HANDLER_mpeg:
+ msg_Dbg( p_demux, "Raw MPEG/PS not supported, passing to ps demux" );
+ goto error;
+ default:
+ break;
+ }
+ }
+ }
+
if( CreateTracks( p_demux, i_tracks ) != VLC_SUCCESS )
goto error;
More information about the vlc-commits
mailing list