diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-15 01:28:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-07-19 15:26:37 +0200 |
commit | 10d821309b02014d7663b63635ff2a3294382558 (patch) | |
tree | c9c647451aabfd9bd8e3cc25a1d65ba3ec67acf3 | |
parent | f8a331598efe22821e4d1f96971adbf716652a7b (diff) | |
download | ffmpeg-10d821309b02014d7663b63635ff2a3294382558.tar.gz |
avcodec/hevcdec: Check nb_sps
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bc406744620710911de9157eafa3e61d0246566f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/hevcdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index f9e8ff0c9f..c05a66d14c 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -247,6 +247,8 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) nb_sps = get_ue_golomb_long(gb); nb_sh = get_ue_golomb_long(gb); + if (nb_sps > sps->num_long_term_ref_pics_sps) + return AVERROR_INVALIDDATA; if (nb_sh + (uint64_t)nb_sps > FF_ARRAY_ELEMS(rps->poc)) return AVERROR_INVALIDDATA; |