[vlc-commits] [Git][videolan/vlc][master] demux: mp4: discard edit list if entries cannot be converted to vlc_tick_t

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Aug 15 10:14:13 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d1f757d7 by Steve Lhomme at 2025-08-15T09:43:35+00:00
demux: mp4: discard edit list if entries cannot be converted to vlc_tick_t

The values are likely wrong.

Fixes https://code.videolan.org/videolan/vlc/-/issues/28997

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -3910,9 +3910,18 @@ static void MP4_TrackSetup( demux_t *p_demux, mp4_track_t *p_track,
         unsigned int i;
 
         msg_Warn( p_demux, "elst box found" );
+        bool use_editlist = var_InheritBool( p_demux, CFG_PREFIX"editlist" );
         for( i = 0; i < elst->i_entry_count; i++ )
         {
             const MP4_Box_data_elst_entry_t *edit = &elst->entries[i];
+            if ( edit->i_segment_duration > INT64_MAX / CLOCK_FREQ ||
+                 ( edit->i_media_time >= 0 && edit->i_media_time > INT64_MAX / CLOCK_FREQ ) )
+            {
+                use_editlist = false;
+                msg_Dbg( p_demux, "   - [%d] bogus duration=%" PRId64 " media time=%" PRId64 ")",
+                         i, edit->i_segment_duration, edit->i_media_time );
+            }
+            else
             msg_Dbg( p_demux, "   - [%d] duration=%"PRId64"ms media time=%"PRId64
                      "ms) rate=%d.%d", i,
                      MP4_rescale( edit->i_segment_duration, p_sys->i_timescale, 1000 ),
@@ -3923,7 +3932,7 @@ static void MP4_TrackSetup( demux_t *p_demux, mp4_track_t *p_track,
                      edit->i_media_rate_fraction );
         }
 
-        if( var_InheritBool( p_demux, CFG_PREFIX"editlist" ) )
+        if( use_editlist )
             p_track->p_elst = p_elst;
         else
             msg_Dbg( p_demux, "ignore editlist" );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d1f757d7f2a68b86d33aa79eeb908b9c047d2a58

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d1f757d7f2a68b86d33aa79eeb908b9c047d2a58
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list