[vlc-commits] [Git][videolan/vlc][3.0.x] demux: ts: fix boundaries check to read in the block

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Aug 2 15:21:57 UTC 2026



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
7e1f479a by Steve Lhomme at 2026-08-02T14:07:26+00:00
demux: ts: fix boundaries check to read in the block

If the buffer (+2) is smaller than the skipped data we should not read
after the skipped data.

So far these data were never read, unless there was a bogus skip. So there
might be some behavior changes.

Ref. #29657

(cherry picked from commit f7d12646eeffd1008b655075db759ed2534485fa)

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -


1 changed file:

- modules/demux/mpeg/ts.c


Changes:

=====================================
modules/demux/mpeg/ts.c
=====================================
@@ -1560,12 +1560,12 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes,
             ( dcd->p_extra[1]&0x10 ) )
         {
             /* display length */
-            if( p_pes->i_buffer + 2 <= i_skip )
+            if( p_pes->i_buffer >= i_skip + 2 )
                 i_length = GetWBE( &p_pes->p_buffer[i_skip] );
 
             i_skip += 2;
         }
-        if( p_pes->i_buffer + 2 <= i_skip )
+        if( p_pes->i_buffer >= i_skip + 2 )
             i_pes_size = GetWBE( &p_pes->p_buffer[i_skip] );
         /* */
         i_skip += 2;



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

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