[FFmpeg-cvslog] avcodec/hevcdec: Check nb_sps
Michael Niedermayer
git at videolan.org
Sun Jun 18 17:36:29 EEST 2017
ffmpeg | branch: release/3.1 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun 15 01:28:28 2017 +0200| [2d7e26277a7b0a349e8c789357924a6659a8eb5f] | committer: Michael Niedermayer
avcodec/hevcdec: Check nb_sps
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit bc406744620710911de9157eafa3e61d0246566f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d7e26277a7b0a349e8c789357924a6659a8eb5f
---
libavcodec/hevc.c | 2 ++
1 file changed, 2 insertions(+)
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;
More information about the ffmpeg-cvslog
mailing list