Commit c36eb466 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

demux/nsv: ignore unsupported blocks

The previous implementation would crash given that p_sys->p_video and
p_sys->p_audio is not guaranteed to be non-NULL (they can be NULL due
to an unsupported codec).

These changes simply make sure that we do not try to send blocks that
do not have have a corresponding ES (causing a crash).

fixes #17571
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent cea401ce
......@@ -277,7 +277,15 @@ static int Demux( demux_t *p_demux )
if( i_size > 0 && ( p_frame = vlc_stream_Block( p_demux->s, i_size ) ) )
{
p_frame->i_dts = VLC_TS_0 + p_sys->i_pcr;
es_out_Send( p_demux->out, p_sys->p_video, p_frame );
if( p_sys->p_video )
es_out_Send( p_demux->out, p_sys->p_video, p_frame );
else
{
block_Release( p_frame );
msg_Dbg( p_demux, "ignoring unsupported video frame (size=%d)",
i_size );
}
}
}
......@@ -305,7 +313,15 @@ static int Demux( demux_t *p_demux )
{
p_frame->i_dts =
p_frame->i_pts = VLC_TS_0 + p_sys->i_pcr;
es_out_Send( p_demux->out, p_sys->p_audio, p_frame );
if( p_sys->p_audio )
es_out_Send( p_demux->out, p_sys->p_audio, p_frame );
else
{
block_Release( p_frame );
msg_Dbg( p_demux, "ignoring unsupported audio frame (size=%d)",
i_size );
}
}
}
......
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