diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-01-11 15:33:42 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-21 14:59:18 +0400 |
commit | 838740e6420538ad45982da6b1d3aa3ae91307f5 (patch) | |
tree | ca4c1bf1bbb9e63e88263bb19b97cf0a504d787c /libavcodec/hevc.c | |
parent | faf03ecba03155bb1f5416713bd01da043863b43 (diff) |
hevc: Prevent some integer overflows
get_ue_golomb_long() returns an unsigned.
Sample-Id: 00001541-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index d5175f52d2..01d3a7758c 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -338,7 +338,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) const HEVCSPS *sps = s->sps; int max_poc_lsb = 1 << sps->log2_max_poc_lsb; int prev_delta_msb = 0; - int nb_sps = 0, nb_sh; + unsigned int nb_sps = 0, nb_sh; int i; rps->nb_refs = 0; @@ -759,7 +759,7 @@ static int hls_slice_header(HEVCContext *s) } if (s->pps->slice_header_extension_present_flag) { - int length = get_ue_golomb_long(gb); + unsigned int length = get_ue_golomb_long(gb); for (i = 0; i < length; i++) skip_bits(gb, 8); // slice_header_extension_data_byte } |