Commit 8acf172f authored by Francois Cartegnie's avatar Francois Cartegnie

demux: itml: fix false positive with xml files

parent 4c1238c7
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <vlc_xml.h> #include <vlc_xml.h>
#include <vlc_strings.h> #include <vlc_strings.h>
#include <vlc_url.h> #include <vlc_url.h>
#include <vlc_fixups.h>
#include "itml.h" #include "itml.h"
#include "playlist.h" #include "playlist.h"
...@@ -52,6 +53,14 @@ int Import_iTML( vlc_object_t *p_this ) ...@@ -52,6 +53,14 @@ int Import_iTML( vlc_object_t *p_this )
{ {
DEMUX_BY_EXTENSION_OR_FORCED_MSG( ".xml", "itml", DEMUX_BY_EXTENSION_OR_FORCED_MSG( ".xml", "itml",
"using iTunes Media Library reader" ); "using iTunes Media Library reader" );
const uint8_t *p_peek;
const uint64_t i_peek = stream_Peek( p_demux->s, &p_peek, 128 );
if ( i_peek < 32 ||
!strnstr( (const char *) p_peek, "<!DOCTYPE plist ", i_peek ) )
{
Close_iTML( p_this );
return VLC_EGENERIC;
}
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
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