[vlc-commits] demux: asf: fix regression with broadcasts

Francois Cartegnie git at videolan.org
Mon Jun 7 09:20:11 UTC 2021


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue May 18 20:15:26 2021 +0200| [e30973a45e8c4f075cf5a6094f500cd3100665f5] | committer: Francois Cartegnie

demux: asf: fix regression with broadcasts

some transmit empty <50 bytes data object

(cherry picked from commit 4ae85635e5998d1b386b834ad22586e807d60969)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=e30973a45e8c4f075cf5a6094f500cd3100665f5
---

 modules/demux/asf/asfpacket.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/demux/asf/asfpacket.c b/modules/demux/asf/asfpacket.c
index bf3a51f709..d37d75bde2 100644
--- a/modules/demux/asf/asfpacket.c
+++ b/modules/demux/asf/asfpacket.c
@@ -405,8 +405,8 @@ int DemuxASFPacket( asf_packet_sys_t *p_packetsys,
 
     const uint64_t i_read_pos = vlc_stream_Tell( p_demux->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;
@@ -477,8 +477,9 @@ int DemuxASFPacket( asf_packet_sys_t *p_packetsys,
     pkt.send_time = 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) )
     {
         msg_Warn( p_demux, "pkt size %"PRIu32" at %"PRIu64" does not fit data chunk",
                   pkt.length, i_read_pos );



More information about the vlc-commits mailing list