[vlc-commits] [Git][videolan/vlc][master] 2 commits: access: mms: enforce packet/header values

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Jul 22 11:55:21 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a265335b by François Cartegnie at 2026-07-22T10:41:43+00:00
access: mms: enforce packet/header values

fixes potential divbyzero on seek

- - - - -
e1b13592 by François Cartegnie at 2026-07-22T10:41:43+00:00
access: mms: document fields

- - - - -


1 changed file:

- modules/access/mms/mmstu.c


Changes:

=====================================
modules/access/mms/mmstu.c
=====================================
@@ -699,7 +699,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)",
@@ -709,7 +709,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 );
@@ -735,17 +735,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 "
@@ -758,6 +758,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/ffb26e2060886c141d1bc889e39846854c228c4c...e1b13592cf95aeb12cd8d399984a40390092c95d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ffb26e2060886c141d1bc889e39846854c228c4c...e1b13592cf95aeb12cd8d399984a40390092c95d
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