diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-04 17:06:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-23 13:15:17 +0200 |
commit | c299d7060e9929e013d5a5b29498a72abfb062a3 (patch) | |
tree | 3ef4956d70b33c9a1b93428f0c2776020e1eb733 | |
parent | 7802a9918de59493e51b1e6a5ff5bcc63c9b5dc9 (diff) | |
download | ffmpeg-c299d7060e9929e013d5a5b29498a72abfb062a3.tar.gz |
avcodec/hevc_ps: Fix runtime error: index 32 out of bounds for type 'uint8_t [32]'
Fixes: 2010/clusterfuzz-testcase-minimized-6209288450080768
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 29808fff339da3e0f26131f7a6209b853947a54b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/hevc_ps.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index e11df99897..bc29f358a2 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -133,6 +133,12 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps, } } + if (k >= FF_ARRAY_ELEMS(rps->used)) { + av_log(s->avctx, AV_LOG_ERROR, + "Invalid num_delta_pocs: %d\n", k); + return AVERROR_INVALIDDATA; + } + rps->num_delta_pocs = k; rps->num_negative_pics = k0; // sort in increasing order (smallest first) |