Commit b7d2d2a8 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: handle peek error code (fix #15819)

parent fc960980
......@@ -161,8 +161,10 @@ static int Open(vlc_object_t *p_obj)
{
/* We need to probe content */
const uint8_t *p_peek;
const size_t i_peek = stream_Peek(p_demux->s, &p_peek, 2048);
stream_t *peekstream = stream_MemoryNew(p_demux, const_cast<uint8_t *>(p_peek), i_peek, true);
const ssize_t i_peek = stream_Peek(p_demux->s, &p_peek, 2048);
if(i_peek > 0)
{
stream_t *peekstream = stream_MemoryNew(p_demux, const_cast<uint8_t *>(p_peek), (size_t)i_peek, true);
if(peekstream)
{
if(xmlParser.reset(peekstream) && xmlParser.parse(false))
......@@ -180,6 +182,7 @@ static int Open(vlc_object_t *p_obj)
}
}
}
}
if(!p_manager || !p_manager->start())
{
......
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