diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-15 01:28:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-16 01:05:30 +0200 |
commit | 6d77a3ff3cd8360874d6f1787c482e09c5239511 (patch) | |
tree | 4d2d31eaebce16c6fb0e41e13a65db7605d7bdb8 /libavcodec | |
parent | 81527019b1d1eb3652b63816738f961cf9a64f49 (diff) | |
download | ffmpeg-6d77a3ff3cd8360874d6f1787c482e09c5239511.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>
Diffstat (limited to 'libavcodec')
-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 764e0938bb..8d1851f368 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; |