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 <[email protected]>
---
 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

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to