Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-04-21 00:27:04 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 14:33:44 +0300
commit5bfafe838e1bc7e985233c2d9f988c77102849c0 (patch)
tree910fd876d25821590440bf3f99526c7a5b5db5a2 /libavcodec
parent2b20b1d2abfdb7480cf676144ef43b643c2acbd0 (diff)
avcodec/cbs_h265_syntax_template: Limit num_long_term_pics more strictly
The limit is based on hevcdec.c Fixes: 20854/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-5160442882424832 Fixes: out of array access Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 435fa373d1f5045b17de74934e44863e2fb3071f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/cbs_h265_syntax_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
index 36f868dbb3..48bf563d1d 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -1313,7 +1313,7 @@ static int FUNC(slice_segment_header)(CodedBitstreamContext *ctx, RWContext *rw,
infer(num_long_term_sps, 0);
idx_size = 0;
}
- ue(num_long_term_pics, 0, HEVC_MAX_LONG_TERM_REF_PICS);
+ ue(num_long_term_pics, 0, HEVC_MAX_REFS - current->num_long_term_sps);
for (i = 0; i < current->num_long_term_sps +
current->num_long_term_pics; i++) {