1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00

avcodec/cbs_h266: use VVC_MAX_VPS_COUNT for range checks and array size

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2023-06-30 08:42:07 -03:00
parent 3fd7841ef1
commit 96d6990517
2 changed files with 2 additions and 7 deletions

View File

@ -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;

View File

@ -639,12 +639,7 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(nal_unit_header) (ctx, rw,
&current->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