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

demux: ts: reject incorrect sized packets

parent 808bf7cb
......@@ -616,6 +616,13 @@ static int Demux( demux_t *p_demux )
p_sys->b_start_record = false;
}
/* Early reject truncated packets from hw devices */
if( unlikely(p_pkt->i_buffer < TS_PACKET_SIZE_188) )
{
block_Release( p_pkt );
continue;
}
/* Parse the TS packet */
ts_pid_t *p_pid = GetPID( p_sys, PIDGet( p_pkt ) );
......@@ -1933,6 +1940,12 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_
break;
}
if( p_pkt->i_size < TS_PACKET_SIZE_188 )
{
block_Release( p_pkt );
continue;
}
const int i_pid = PIDGet( p_pkt );
ts_pid_t *p_pid = GetPID(p_sys, i_pid);
......
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