[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: access: mms: enforce packet/header values
François Cartegnie (@fcartegnie)
gitlab at videolan.org
Tue Sep 1 05:32:15 UTC 2026
François Cartegnie pushed to branch 3.0.x at VideoLAN / VLC
Commits:
d6bd5aa1 by François Cartegnie at 2026-09-01T07:25:14+02:00
access: mms: enforce packet/header values
fixes potential divbyzero on seek
(cherry picked from commit a265335b7207cb68dcef7ccea03e10392fea04ec)
- - - - -
f817dce9 by François Cartegnie at 2026-09-01T07:25:14+02:00
access: mms: document fields
(cherry picked from commit e1b13592cf95aeb12cd8d399984a40390092c95d)
- - - - -
1 changed file:
- modules/access/mms/mmstu.c
Changes:
=====================================
modules/access/mms/mmstu.c
=====================================
@@ -703,7 +703,7 @@ do \
MMSClose( p_access );
return VLC_EGENERIC;
}
- if( p_sys->i_command != 0x06 )
+ if( p_sys->i_command != 0x06 ) // MID: 0x00040006
{
msg_Err( p_access,
"unknown answer (0x%x instead of 0x06)",
@@ -713,7 +713,7 @@ do \
return( -1 );
}
- if( p_sys->i_cmd < MMS_CMD_HEADERSIZE + 64 )
+ if( p_sys->i_cmd < MMS_CMD_HEADERSIZE + 64 ) // 2.2.4.7 LinkMacToViewerReportOpenFile
{
var_buffer_free( &buffer );
MMSClose( p_access );
@@ -739,17 +739,17 @@ do \
}
p_sys->i_flags_broadcast =
- GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 12 );
+ GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 12 ); // fileAttributes
p_sys->i_media_length =
- GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 24 );
+ GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 24 ); // fileDuration
p_sys->i_packet_length =
- GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 44 );
+ GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 44 ); // filePacketSize
p_sys->i_packet_count =
- GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 48 );
+ GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 48 ); // filePacketCount
p_sys->i_max_bit_rate =
- GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 56 );
+ GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 56 ); // fileBitRate
p_sys->i_header_size =
- GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 60 );
+ GetDWLE( p_sys->p_cmd + MMS_CMD_HEADERSIZE + 60 ); // fileHeaderSize
msg_Dbg( p_access,
"answer 0x06 flags:0x%8.8"PRIx32" media_length:%"PRIu32"s "
@@ -762,6 +762,14 @@ do \
p_sys->i_max_bit_rate,
p_sys->i_header_size );
+ if( p_sys->i_packet_length == 0 || p_sys->i_header_size == 0 )
+ {
+ msg_Err( p_access, "invalid values detected" );
+ var_buffer_free( &buffer );
+ MMSClose( p_access );
+ return VLC_EGENERIC;
+ }
+
/* *** send command 15 *** */
var_buffer_reinitwrite( &buffer, 0 );
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5d6318ce39c2dbd2c055ecb15451c6306814cfde...f817dce9e2f2005c0ec01b21a148affdbe1f669e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5d6318ce39c2dbd2c055ecb15451c6306814cfde...f817dce9e2f2005c0ec01b21a148affdbe1f669e
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list