diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 43def9220f..029fbd5e4f 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -1151,7 +1151,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, else infer(sps_subpic_width_minus1[0], max_width_minus1); if (current->sps_pic_height_max_in_luma_samples > ctb_size_y) - us(hlen, sps_subpic_height_minus1[0], 0, max_width_minus1, 1, 0); + us(hlen, sps_subpic_height_minus1[0], 0, max_height_minus1, 1, 0); else infer(sps_subpic_height_minus1[0], max_height_minus1); if (!current->sps_independent_subpics_flag) {