diff options
author | Nuo Mi <nuomi2021@gmail.com> | 2023-09-19 23:25:55 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-09-19 21:28:40 +0200 |
commit | 9ef20920ab82c46de095499deec2777b48a19370 (patch) | |
tree | 14a19401490b45b231f489a316b79607120cf4fb | |
parent | 13d22dc45403abee69af51b4150668a4a627492c (diff) | |
download | ffmpeg-9ef20920ab82c46de095499deec2777b48a19370.tar.gz |
avcodec/cbs_h266_syntax_template: Check num_output_layers_in_ols
from the specification:
For each OLS, there shall be at least one layer that is an output layer. In other words, for any value of i in the range of 0
to TotalNumOlss − 1, inclusive, the value of NumOutputLayersInOls[ i ] shall be greater than or equal to 1
Fixes: index 257 out of bounds for type 'uint8_t [257]'
Fixes: 61160/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_METADATA_fuzzer-6709397181825024
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/cbs_h266_syntax_template.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 4075897b9a..aecc4d79f8 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -891,6 +891,8 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, } } } + if (!num_output_layers_in_ols[i]) + return AVERROR_INVALIDDATA; } for (i = 1; i < total_num_olss; i++) { int num_layers_in_ols = 0; |