[FFmpeg-cvslog] avcodec/hevcdec: Check nb_sps

Michael Niedermayer git at videolan.org
Wed Jul 19 17:53:25 EEST 2017


ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun 15 01:28:28 2017 +0200| [10d821309b02014d7663b63635ff2a3294382558] | 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=10d821309b02014d7663b63635ff2a3294382558
---

 libavcodec/hevcdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index f9e8ff0c9f..c05a66d14c 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -247,6 +247,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