[vlc-commits] [Git][videolan/vlc][3.0.x] packetizer: hevc: cap max_num_negative/positive_pics

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri Mar 27 06:09:42 UTC 2026



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


Commits:
2eb3f45a by François Cartegnie at 2026-03-27T06:25:10+01:00
packetizer: hevc: cap max_num_negative/positive_pics

refs #29559

(adapted from commit aa0bb8e56211d7fa7367291f54d9e4db61ae158f)

- - - - -


1 changed file:

- modules/packetizer/hevc_nal.c


Changes:

=====================================
modules/packetizer/hevc_nal.c
=====================================
@@ -759,7 +759,10 @@ static bool hevc_parse_st_ref_pic_set( bs_t *p_bs, unsigned stRpsIdx,
     {
         nal_ue_t num_negative_pics = bs_read_ue( p_bs );
         nal_ue_t num_positive_pics = bs_read_ue( p_bs );
-        if( bs_remain( p_bs ) < ((int64_t)num_negative_pics + num_positive_pics) * 2 )
+        // A.4.2 total to (MaxDpbSize -1) with MaxDpbSize capped either at 16 or 7
+        if( num_negative_pics >= 16 || num_positive_pics >= 16 ||
+            num_negative_pics + num_positive_pics >= 16 ||
+            bs_remain( p_bs ) < ((int64_t)num_negative_pics + num_positive_pics) * 2 )
             return false;
         for(unsigned int i=0; i<num_negative_pics; i++)
         {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2eb3f45a4d332d29fef11273973cc59e67c280c0

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




More information about the vlc-commits mailing list