Commit 4ae85635 authored by François Cartegnie's avatar François Cartegnie 🤞 Committed by Jean-Baptiste Kempf
Browse files

demux: asf: fix regression with broadcasts

some transmit empty <50 bytes data object
parent f7bd45a7
......@@ -411,8 +411,8 @@ int DemuxASFPacket( asf_packet_sys_t *p_packetsys,
{
const uint64_t i_read_pos = vlc_stream_Tell( p_packetsys->s );
if( i_read_pos < i_data_begin ||
i_data_packet_min > i_data_end ||
i_read_pos > i_data_end - i_data_packet_min )
(i_data_end && ( i_data_packet_min > i_data_end ||
i_read_pos > i_data_end - i_data_packet_min ) ) )
return 0;
const uint8_t *p_peek;
......@@ -483,8 +483,9 @@ int DemuxASFPacket( asf_packet_sys_t *p_packetsys,
pkt.send_time = VLC_TICK_FROM_MS(GetDWLE( p_peek + i_skip )); i_skip += 4;
/* uint16_t i_packet_duration = GetWLE( p_peek + i_skip ); */ i_skip += 2;
if( pkt.length > i_data_end ||
i_read_pos > i_data_end - pkt.length )
if( i_data_end &&
(pkt.length > i_data_end ||
i_read_pos > i_data_end - pkt.length) )
{
vlc_warning( p_packetsys->logger, "pkt size %"PRIu32" at %"PRIu64" does not fit data chunk size %"PRIu32,
pkt.length, i_read_pos, i_data_packet_max );
......
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