[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: mp4: check for insufficient data in rdrf box

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Nov 16 07:40:38 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
0801873a by Gabriel Dezejácomo Maruschi at 2026-11-16T07:12:54+00:00
demux: mp4: check for insufficient data in rdrf box

If the declared string length (i_len) exceeds the remaining
payload size of the box (i_read), MP4_COPY_BYTES only copies
the available bytes without reporting an error.

Abort box parsing early when there is not enough data left.

- - - - -
493793a3 by Gabriel Dezejácomo Maruschi at 2026-11-16T07:12:54+00:00
Revert "demux: libmp4: simplify string length check"

This reverts commit 7daea2eee6576d7fb616c66cd6f482ec0b9e9d87.
Fixes #29970
Reported-by: HE WEI (ギカク) <skyexpoc at gmail.com>

- - - - -


1 changed file:

- modules/demux/mp4/libmp4.c


Changes:

=====================================
modules/demux/mp4/libmp4.c
=====================================
@@ -3691,11 +3691,16 @@ static int MP4_ReadBox_rdrf( stream_t *p_stream, MP4_Box_t *p_box )
     MP4_GETFOURCC( p_box->data.p_rdrf->i_ref_type );
     MP4_GET4BYTES( i_len );
 
-    if( i_len != 0 )
+    if( i_len > i_read )
+        MP4_READBOX_EXIT( 0 );
+
+    i_len++;
+    if( i_len > 0 )
     {
-        p_box->data.p_rdrf->psz_ref = malloc( i_len + 1 );
+        p_box->data.p_rdrf->psz_ref = malloc( i_len );
         if( p_box->data.p_rdrf->psz_ref == NULL )
             MP4_READBOX_EXIT( 0 );
+        i_len--;
 
         MP4_COPY_BYTES( p_box->data.p_rdrf->psz_ref, i_len );
         p_box->data.p_rdrf->psz_ref[i_len] = '\0';



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8361399713267b27921ef773fa4e58b668f76680...493793a33a2c013b5d8b4a6b223c27cdb771df0d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8361399713267b27921ef773fa4e58b668f76680...493793a33a2c013b5d8b4a6b223c27cdb771df0d
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