[vlc-commits] [Git][videolan/vlc][3.0.x] packetizer: h264_nal: avoid integer overflow

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Mar 19 12:39:58 UTC 2026



Felix Paul Kühne pushed to branch 3.0.x at VideoLAN / VLC


Commits:
14b6caf7 by Tristan Matthews at 2026-03-19T13:01:05+01:00
packetizer: h264_nal: avoid integer overflow

The expected range should be between 0 and 12.

(cherry picked from commit 8c2be59ea7769b7b67aa32891927600d8fe91150)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -


1 changed file:

- modules/packetizer/h264_nal.c


Changes:

=====================================
modules/packetizer/h264_nal.c
=====================================
@@ -345,8 +345,9 @@ static bool h264_parse_sequence_parameter_set_rbsp( bs_t *p_bs,
 
     /* Skip i_log2_max_frame_num */
     p_sps->i_log2_max_frame_num = bs_read_ue( p_bs );
-    if( p_sps->i_log2_max_frame_num > 12)
+    if( (uint_fast32_t) p_sps->i_log2_max_frame_num > 12)
         p_sps->i_log2_max_frame_num = 12;
+
     /* Read poc_type */
     p_sps->i_pic_order_cnt_type = bs_read_ue( p_bs );
     if( p_sps->i_pic_order_cnt_type == 0 )



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

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




More information about the vlc-commits mailing list