Commit eb2e9471 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: mp4: fully check major for f4v

parent dcb6fa67
......@@ -37,6 +37,7 @@ typedef int64_t stime_t;
#define MAJOR_isml VLC_FOURCC( 'i', 's', 'm', 'l' )
#define MAJOR_isom VLC_FOURCC( 'i', 's', 'o', 'm' )
#define MAJOR_qt__ VLC_FOURCC( 'q', 't', ' ', ' ' )
#define MAJOR_f4v VLC_FOURCC( 'f', '4', 'v', ' ' ) /* Adobe Flash */
#define MAJOR_dash VLC_FOURCC( 'd', 'a', 's', 'h' )
#define MAJOR_mp41 VLC_FOURCC( 'm', 'p', '4', '1' )
#define MAJOR_avc1 VLC_FOURCC( 'a', 'v', 'c', '1' )
......
......@@ -685,7 +685,7 @@ static int Open( vlc_object_t * p_this )
bool b_enabled_es;
/* A little test to see if it could be a mp4 */
if( vlc_stream_Peek( p_demux->s, &p_peek, 11 ) < 11 ) return VLC_EGENERIC;
if( vlc_stream_Peek( p_demux->s, &p_peek, 12 ) < 12 ) return VLC_EGENERIC;
switch( VLC_FOURCC( p_peek[4], p_peek[5], p_peek[6], p_peek[7] ) )
{
......@@ -701,10 +701,18 @@ static int Open( vlc_object_t * p_this )
case VLC_FOURCC( 'p', 'n', 'o', 't' ):
break;
case ATOM_ftyp:
/* We don't yet support f4v, but avformat does. */
if( p_peek[8] == 'f' && p_peek[9] == '4' && p_peek[10] == 'v' )
return VLC_EGENERIC;
{
/* Early handle some brands */
switch( VLC_FOURCC(p_peek[8], p_peek[9], p_peek[10], p_peek[11]) )
{
/* We don't yet support f4v, but avformat does. */
case MAJOR_f4v:
return VLC_EGENERIC;
default:
break;
}
break;
}
default:
return VLC_EGENERIC;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment