[FFmpeg-cvslog] avcodec/hevc_refs: Check nb_refs in add_candidate_ref()

Michael Niedermayer git at videolan.org
Thu Jun 15 04:10:14 EEST 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun 15 01:26:01 2017 +0200| [1cb4ef526dd1e5f547d0354efb0831d07e967919] | committer: 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/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1cb4ef526dd1e5f547d0354efb0831d07e967919
---

 libavcodec/hevc_refs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index f9818c958e..68c730edcc 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -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) {



More information about the ffmpeg-cvslog mailing list