[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: asf: have data_end match libasf broadcast dump detection

Jean-Baptiste Kempf gitlab at videolan.org
Wed May 19 20:11:09 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
f7bd45a7 by Francois Cartegnie at 2021-05-19T19:57:49+00:00
demux: asf: have data_end match libasf broadcast dump detection

- - - - -
4ae85635 by Francois Cartegnie at 2021-05-19T19:57:49+00:00
demux: asf: fix regression with broadcasts

some transmit empty <50 bytes data object

- - - - -


2 changed files:

- modules/demux/asf/asf.c
- modules/demux/asf/asfpacket.c


Changes:

=====================================
modules/demux/asf/asf.c
=====================================
@@ -1228,7 +1228,7 @@ static int DemuxInit( demux_t *p_demux )
     free( fmt_priorities_bitrate_ex.pi_stream_numbers );
 
     p_sys->i_data_begin = p_sys->p_root->p_data->i_object_pos + 50;
-    if( p_sys->p_root->p_data->i_object_size != 0 )
+    if( p_sys->p_root->p_data->i_object_size > 50 ) /* see libasf ASF_OBJECT_DATA <= 50 handling */
     { /* local file */
         p_sys->i_data_end = p_sys->p_root->p_data->i_object_pos +
                                     p_sys->p_root->p_data->i_object_size;


=====================================
modules/demux/asf/asfpacket.c
=====================================
@@ -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 );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a7b258c17eab7b2055ffe4e964b4189b149005bd...4ae85635e5998d1b386b834ad22586e807d60969

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a7b258c17eab7b2055ffe4e964b4189b149005bd...4ae85635e5998d1b386b834ad22586e807d60969
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list