[vlc-commits] [Git][videolan/vlc][3.0.x] demux: ty: add some sanity checks before use video buffer

François Cartegnie (@fcartegnie) gitlab at videolan.org
Sun Sep 13 11:19:06 UTC 2026



François Cartegnie pushed to branch 3.0.x at VideoLAN / VLC


Commits:
6dbbbbea by Steve Lhomme at 2026-09-13T06:45:18+02:00
demux: ty: add some sanity checks before use video buffer

Fixes #30024

(cherry picked from commit ef4d48add2cd290f5a1d7dd62d0458bed3ba1cce)

- - - - -


1 changed file:

- modules/demux/ty.c


Changes:

=====================================
modules/demux/ty.c
=====================================
@@ -704,7 +704,8 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
          * Do NOT Pass the PES Header to the MPEG2 codec */
         size_t search_len = __MIN(p_block_in->i_buffer - sizeof(ty_VideoPacket), 5);
         esOffset1 = find_es_header( ty_VideoPacket, p_block_in->p_buffer, p_block_in->i_buffer, search_len );
-        if( esOffset1 != -1 )
+        if( esOffset1 != -1 &&
+            (size_t)esOffset1 + VIDEO_PTS_OFFSET + 5 <= p_block_in->i_buffer ) // to read the PTS
         {
             //msg_Dbg(p_demux, "Video PES hdr in pkt type 0x%02x at offset %d",
                 //subrec_type, esOffset1);



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

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