Commit 1cb4ef52 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent e53c9065
......@@ -431,7 +431,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 >= HEVC_MAX_REFS)
return AVERROR_INVALIDDATA;
if (!ref) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment