[vlc-commits] [Git][videolan/vlc][3.0.x] demux: ts: fix opus read limits

François Cartegnie (@fcartegnie) gitlab at videolan.org
Mon Sep 7 07:23:01 UTC 2026



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


Commits:
7653ed22 by François Cartegnie at 2026-09-07T09:12:22+02:00
demux: ts: fix opus read limits

fix #29681

(cherry picked from commit 2b3db140b49beba2ceb2cb3dfee47f2f049237c7)

- - - - -


1 changed file:

- modules/demux/mpeg/ts.c


Changes:

=====================================
modules/demux/mpeg/ts.c
=====================================
@@ -62,6 +62,7 @@
 #endif
 
 #include <assert.h>
+#include <limits.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -1230,11 +1231,16 @@ static block_t *Opus_Parse(demux_t *demux, block_t *block)
         buf += 2;
 
         unsigned au_size = 0;
-        while (len--) {
+        for (;len;len--) {
             int c = *buf++;
             au_size += c;
             if (c != 0xff)
                 break;
+            if (au_size > UINT_MAX/2)
+            {
+                len = 0;
+                break;
+            }
         }
 
         if (start_trim_flag) {



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

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