[FFmpeg-cvslog] avcodec/hevc: fix nb_sh / nb_sps check

Michael Niedermayer git at videolan.org
Sat Jul 12 07:51:28 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jul 12 04:39:01 2014 +0200| [c79acacd2ef222fbc644bf7d832d85c626c10d0d] | committer: Michael Niedermayer

avcodec/hevc: fix nb_sh / nb_sps check

fixes integer overflow

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c79acacd2ef222fbc644bf7d832d85c626c10d0d
---

 libavcodec/hevc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 0b14c74..8ae8fc7 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -243,7 +243,7 @@ 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_sh + nb_sps > FF_ARRAY_ELEMS(rps->poc))
+    if (nb_sh + (uint64_t)nb_sps > FF_ARRAY_ELEMS(rps->poc))
         return AVERROR_INVALIDDATA;
 
     rps->nb_refs = nb_sh + nb_sps;



More information about the ffmpeg-cvslog mailing list