[FFmpeg-cvslog] avcodec/cbs_av1: add missing valid range of values for num_cb_points and num_cr_points

James Almer git at videolan.org
Thu Dec 19 19:08:57 EET 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Dec 11 22:39:56 2019 -0300| [8887991a3109f94b7d019a11a86e6cd900105258] | committer: James Almer

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8887991a3109f94b7d019a11a86e6cd900105258
---

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



More information about the ffmpeg-cvslog mailing list