Commit 278b8d18 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 29808fff)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 0ad5a36b
...@@ -169,6 +169,12 @@ int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx, ...@@ -169,6 +169,12 @@ int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx,
} }
} }
if (k >= FF_ARRAY_ELEMS(rps->used)) {
av_log(avctx, AV_LOG_ERROR,
"Invalid num_delta_pocs: %d\n", k);
return AVERROR_INVALIDDATA;
}
rps->num_delta_pocs = k; rps->num_delta_pocs = k;
rps->num_negative_pics = k0; rps->num_negative_pics = k0;
// sort in increasing order (smallest first) // sort in increasing order (smallest first)
......
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