Commit c79acacd authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/hevc: fix nb_sh / nb_sps check

fixes integer overflow
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ca671bee
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment