diff options
author | James Almer <jamrial@gmail.com> | 2024-05-19 10:26:38 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2024-05-20 10:29:30 -0300 |
commit | b113050d96d9d36ac2e7f10b3af8b9c61684c33f (patch) | |
tree | 92792b45b9fec988146bc8fb48cf8c15b131ce3b /libavcodec | |
parent | 0d7430d3ab9a818e14f99176dc7fe55860b184a1 (diff) | |
download | ffmpeg-b113050d96d9d36ac2e7f10b3af8b9c61684c33f.tar.gz |
avcodec/cbs_h266: read vps_ptl_max_tid before using it
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/cbs_h266_syntax_template.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 725cee5b03..38685704c5 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -790,6 +790,21 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, infer(vps_each_layer_is_an_ols_flag, 1); infer(vps_num_ptls_minus1, 0); } + + for (i = 0; i <= current->vps_num_ptls_minus1; i++) { + if (i > 0) + flags(vps_pt_present_flag[i], 1, i); + else + infer(vps_pt_present_flag[i], 1); + + if (!current->vps_default_ptl_dpb_hrd_max_tid_flag) + us(3, vps_ptl_max_tid[i], 0, current->vps_max_sublayers_minus1, 1, i); + else + infer(vps_ptl_max_tid[i], current->vps_max_sublayers_minus1); + } + while (byte_alignment(rw) != 0) + fixed(1, vps_ptl_alignment_zero_bit, 0); + { //calc NumMultiLayerOlss int m; @@ -916,19 +931,6 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, } for (i = 0; i <= current->vps_num_ptls_minus1; i++) { - if (i > 0) - flags(vps_pt_present_flag[i], 1, i); - else - infer(vps_pt_present_flag[i], 1); - - if (!current->vps_default_ptl_dpb_hrd_max_tid_flag) - us(3, vps_ptl_max_tid[i], 0, current->vps_max_sublayers_minus1, 1, i); - else - infer(vps_ptl_max_tid[i], current->vps_max_sublayers_minus1); - } - while (byte_alignment(rw) != 0) - fixed(1, vps_ptl_alignment_zero_bit, 0); - for (i = 0; i <= current->vps_num_ptls_minus1; i++) { CHECK(FUNC(profile_tier_level) (ctx, rw, current->vps_profile_tier_level + i, current->vps_pt_present_flag[i], |