aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-15 01:28:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-16 01:07:19 +0200
commitc8733c73763ff280cca91be740d11cf3853a9439 (patch)
treeca3637943817ad5ffbea29592ac4e25f635785a5
parentc2562f5a8e0cfb80a3050f557bb8f5de830bf358 (diff)
downloadffmpeg-c8733c73763ff280cca91be740d11cf3853a9439.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 5f777612c2..a9f11006bb 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -244,6 +244,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;