[vlc-commits] [Git][videolan/vlc][3.0.x] mpeg4video: add early check on zero i_fps_num

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Aug 15 07:02:34 UTC 2026



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


Commits:
7bbeddd4 by Steve Lhomme at 2026-08-15T06:46:18+00:00
mpeg4video: add early check on zero i_fps_num

When i_fps_num is read it can never be 0.
If it's 0 it has not be read. And we can't use i_fps_num - 1 to
find the number of increment bits to read.

Fixes #29756

(cherry picked from commit 28a958d3b4180941c85a70509e73807c4fd7094c) (edited)
edited:
- VLC 3 doesn't have a backport of bc243c4db9d32bcc6d2af35f06d14880c738d79b
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -


1 changed file:

- modules/packetizer/mpeg4video.c


Changes:

=====================================
modules/packetizer/mpeg4video.c
=====================================
@@ -491,6 +491,9 @@ static int ParseVOP( decoder_t *p_dec, block_t *p_vop )
     int i_modulo_time_base = 0, i_time_increment_bits;
     bs_t s;
 
+    if( p_sys->i_fps_num == 0 )
+        return VLC_EGENERIC;
+
     bs_init( &s, &p_vop->p_buffer[4], p_vop->i_buffer - 4 );
 
     switch( bs_read( &s, 2 ) )
@@ -546,7 +549,7 @@ static int ParseVOP( decoder_t *p_dec, block_t *p_vop )
         p_dec->fmt_in.video.i_frame_rate_base /
         p_dec->fmt_in.video.i_frame_rate;
     }
-    else if( p_dec->p_sys->i_fps_num )
+    else
         p_sys->i_interpolated_pts +=
             ( CLOCK_FREQ * (i_time_ref + i_time_increment -
               p_sys->i_last_time - p_sys->i_last_timeincr) /



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

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