1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/cbs_av1_syntax_template: Check num_y_points

"It is a requirement of bitstream conformance that num_y_points is less than or equal to 14."

Fixes: index 24 out of bounds for type 'uint8_t [24]'
Fixes: 19282/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_FRAME_MERGE_fuzzer-5747424845103104

Note, also needs a23dd33606

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: jamrial
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2019-12-11 22:03:50 +01:00
parent e52070e89c
commit bbe27890ff
2 changed files with 3 additions and 3 deletions

View File

@ -256,8 +256,8 @@ typedef struct AV1RawFrameHeader {
uint8_t update_grain;
uint8_t film_grain_params_ref_idx;
uint8_t num_y_points;
uint8_t point_y_value[16];
uint8_t point_y_scaling[16];
uint8_t point_y_value[14];
uint8_t point_y_scaling[14];
uint8_t chroma_scaling_from_luma;
uint8_t num_cb_points;
uint8_t point_cb_value[16];

View File

@ -1155,7 +1155,7 @@ static int FUNC(film_grain_params)(CodedBitstreamContext *ctx, RWContext *rw,
return 0;
}
fb(4, num_y_points);
fc(4, num_y_points, 0, 14);
for (i = 0; i < current->num_y_points; i++) {
fbs(8, point_y_value[i], 1, i);
fbs(8, point_y_scaling[i], 1, i);