aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-15 01:28:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:18 +0200
commitccc14ccc45ca6d5abe54d049f6178edc3593e7f9 (patch)
tree4cb2e186deb21423dbb30938f91201281f5877cb
parent947961a6dc989d5532753cf187b3b7830acf3e5d (diff)
downloadffmpeg-ccc14ccc45ca6d5abe54d049f6178edc3593e7f9.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/hevc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index d29343b306..acdfcdb8f1 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -240,6 +240,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;