[FFmpeg-devel] [PATCH] lavc/vvc: Add missing bounds for first subpic size

Frank Plowman post at frankplowman.com
Sun Nov 17 14:27:40 EET 2024


Add missing upper bounds for the width and height of the first
subpicture.  Corresponding bounds were added for all other subpictures
in 01701bd, but were not included for the first subpicture (which has
slightly different syntax).

Signed-off-by: Frank Plowman <post at frankplowman.com>
---
 libavcodec/cbs_h266_syntax_template.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index 6b2d6534ef..96704936ba 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -1145,11 +1145,11 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
             infer(sps_subpic_ctu_top_left_x[0], 0);
             infer(sps_subpic_ctu_top_left_y[0], 0);
             if (current->sps_pic_width_max_in_luma_samples > ctb_size_y)
-                ubs(wlen, sps_subpic_width_minus1[0], 1, 0);
+                us(wlen, sps_subpic_width_minus1[0], 0, tmp_width_val - 1, 1, 0);
             else
                 infer(sps_subpic_width_minus1[0], tmp_width_val - 1);
             if (current->sps_pic_height_max_in_luma_samples > ctb_size_y)
-                ubs(hlen, sps_subpic_height_minus1[0], 1, 0);
+                us(hlen, sps_subpic_height_minus1[0], 0, tmp_height_val - 1, 1, 0);
             else
                 infer(sps_subpic_height_minus1[0], tmp_height_val - 1);
             if (!current->sps_independent_subpics_flag) {
-- 
2.47.0



More information about the ffmpeg-devel mailing list