diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-15 01:28:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-18 16:05:23 +0200 |
commit | 2d7e26277a7b0a349e8c789357924a6659a8eb5f (patch) | |
tree | c0f1ffb4aa41e0d223c862c09511803ae8a49423 | |
parent | 8d0c353b733bb36919b7c2ec7ae92d75d28196ed (diff) | |
download | ffmpeg-2d7e26277a7b0a349e8c789357924a6659a8eb5f.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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index cb1263cb43..3389b7f5c7 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -246,6 +246,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; |