[FFmpeg-cvslog] avcodec/hevcdec: Check nb_sps
Michael Niedermayer
git at videolan.org
Thu Aug 24 15:04:58 EEST 2017
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun 15 01:28:28 2017 +0200| [c8733c73763ff280cca91be740d11cf3853a9439] | 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=c8733c73763ff280cca91be740d11cf3853a9439
---
libavcodec/hevc.c | 2 ++
1 file changed, 2 insertions(+)
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;
More information about the ffmpeg-cvslog
mailing list