avcodec/cbs_av1: add missing valid range of values for num_cb_points and num_cr_points

It is a requirement of bitstream conformance that num_cr_points is less than or equal to 10.
It is a requirement of bitstream conformance that num_cb_points is less than or equal to 10.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2019-12-11 22:39:56 -03:00
parent aad0e26f93
commit 8887991a31
2 changed files with 6 additions and 6 deletions

View File

@ -260,11 +260,11 @@ typedef struct AV1RawFrameHeader {
uint8_t point_y_scaling[14];
uint8_t chroma_scaling_from_luma;
uint8_t num_cb_points;
uint8_t point_cb_value[16];
uint8_t point_cb_scaling[16];
uint8_t point_cb_value[10];
uint8_t point_cb_scaling[10];
uint8_t num_cr_points;
uint8_t point_cr_value[16];
uint8_t point_cr_scaling[16];
uint8_t point_cr_value[10];
uint8_t point_cr_scaling[10];
uint8_t grain_scaling_minus_8;
uint8_t ar_coeff_lag;
uint8_t ar_coeffs_y_plus_128[24];

View File

@ -1174,12 +1174,12 @@ static int FUNC(film_grain_params)(CodedBitstreamContext *ctx, RWContext *rw,
infer(num_cb_points, 0);
infer(num_cr_points, 0);
} else {
fb(4, num_cb_points);
fc(4, num_cb_points, 0, 10);
for (i = 0; i < current->num_cb_points; i++) {
fbs(8, point_cb_value[i], 1, i);
fbs(8, point_cb_scaling[i], 1, i);
}
fb(4, num_cr_points);
fc(4, num_cr_points, 0, 10);
for (i = 0; i < current->num_cr_points; i++) {
fbs(8, point_cr_value[i], 1, i);
fbs(8, point_cr_scaling[i], 1, i);