diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-15 01:26:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-16 01:05:30 +0200 |
commit | 81527019b1d1eb3652b63816738f961cf9a64f49 (patch) | |
tree | f51c184762c25478195d2f881e5a8c13949ba5c0 /libavcodec | |
parent | 3c6aa2e0d12f403cba22bd95a675f975e8e6bb3b (diff) | |
download | ffmpeg-81527019b1d1eb3652b63816738f961cf9a64f49.tar.gz |
avcodec/hevc_refs: Check nb_refs in add_candidate_ref()
Fixes: runtime error: index 16 out of bounds for type 'int [16]'
Fixes: 2209/clusterfuzz-testcase-minimized-5012343912136704
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 1cb4ef526dd1e5f547d0354efb0831d07e967919)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hevc_refs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c index 611ad458de..df52e401ad 100644 --- a/libavcodec/hevc_refs.c +++ b/libavcodec/hevc_refs.c @@ -438,7 +438,7 @@ static int add_candidate_ref(HEVCContext *s, RefPicList *list, { HEVCFrame *ref = find_ref_idx(s, poc); - if (ref == s->ref) + if (ref == s->ref || list->nb_refs >= MAX_REFS) return AVERROR_INVALIDDATA; if (!ref) { |