diff options
author | James Almer <jamrial@gmail.com> | 2019-12-11 22:39:56 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-12-19 01:04:10 -0300 |
commit | 8887991a3109f94b7d019a11a86e6cd900105258 (patch) | |
tree | b6c0953203e27f6c8b83283892e4f12f4fbf4639 | |
parent | aad0e26f9312d380e613e312a3b307609296fe58 (diff) | |
download | ffmpeg-8887991a3109f94b7d019a11a86e6cd900105258.tar.gz |
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>
-rw-r--r-- | libavcodec/cbs_av1.h | 8 | ||||
-rw-r--r-- | libavcodec/cbs_av1_syntax_template.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h index 5466151f73..fdc629b00c 100644 --- a/libavcodec/cbs_av1.h +++ b/libavcodec/cbs_av1.h @@ -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]; diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c index 523f9359e4..f830fb1517 100644 --- a/libavcodec/cbs_av1_syntax_template.c +++ b/libavcodec/cbs_av1_syntax_template.c @@ -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); |