[FFmpeg-devel] [PATCH] avcodec/cbs_av1: add missing valid range of values for num_cb_points and num_cr_points
James Almer
jamrial at gmail.com
Fri Dec 13 22:44:49 EET 2019
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 at gmail.com>
---
libavcodec/cbs_av1.h | 8 ++++----
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 643e76793f..9306bc59d6 100644
--- a/libavcodec/cbs_av1.h
+++ b/libavcodec/cbs_av1.h
@@ -260,11 +260,11 @@ typedef struct AV1RawFrameHeader {
uint8_t point_y_scaling[16];
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 f53955c52e..848348af7d 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);
--
2.24.0
More information about the ffmpeg-devel
mailing list