aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-15 01:26:01 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-16 01:07:19 +0200
commitc2562f5a8e0cfb80a3050f557bb8f5de830bf358 (patch)
treec61a483512100c4bab9b2c86c4abbb2f93b0f5eb
parent7bca492cfcc7e17e7d9ea5697c318283bee45984 (diff)
downloadffmpeg-c2562f5a8e0cfb80a3050f557bb8f5de830bf358.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>
-rw-r--r--libavcodec/hevc_refs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index 1df3671861..daea861f19 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) {