avcodec/hevc: fix nb_sh / nb_sps check
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Jul 2014 02:39:01 +0000 (04:39 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Jul 2014 02:39:01 +0000 (04:39 +0200)
fixes integer overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/hevc.c

index 0b14c74..8ae8fc7 100644 (file)
@@ -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;