diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h index 54590748c3..be3c744426 100644 --- a/libavcodec/cbs_h266.h +++ b/libavcodec/cbs_h266.h @@ -775,7 +775,7 @@ typedef struct CodedBitstreamH266Context { AVBufferRef *sps_ref[VVC_MAX_SPS_COUNT]; AVBufferRef *pps_ref[VVC_MAX_PPS_COUNT]; AVBufferRef *ph_ref; - H266RawVPS *vps[VVC_MAX_SPS_COUNT]; + H266RawVPS *vps[VVC_MAX_VPS_COUNT]; H266RawSPS *sps[VVC_MAX_SPS_COUNT]; H266RawPPS *pps[VVC_MAX_PPS_COUNT]; H266RawPictureHeader *ph; diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index b23a80d356..863fecdefa 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -639,12 +639,7 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, CHECK(FUNC(nal_unit_header) (ctx, rw, ¤t->nal_unit_header, VVC_VPS_NUT)); - ub(4, vps_video_parameter_set_id); - if (current->vps_video_parameter_set_id == 0) { - av_log(ctx->log_ctx, AV_LOG_ERROR, - "vps_video_parameter_set_id should > 0.\n"); - return AVERROR_INVALIDDATA; - } + u(4, vps_video_parameter_set_id, 1, VVC_MAX_VPS_COUNT - 1); ub(6, vps_max_layers_minus1); u(3, vps_max_sublayers_minus1, 0, 6); if (current->vps_max_layers_minus1 > 0