aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-19 19:52:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-23 23:21:14 +0200
commitd52fabaec00440a4615814805210e0eaad6ba3cb (patch)
tree4029d36a8b120db47a4e70d8526388cfce25d69e
parent419eee63565f81aca67b29582297841c59deaab8 (diff)
downloadffmpeg-d52fabaec00440a4615814805210e0eaad6ba3cb.tar.gz
avcodec/hevc/hevcdec: avoid signed shifts with lt_idx_sps
Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 70122/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5172200613675008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/hevc/hevcdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 6b3cf0fec3..526194eb80 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -292,7 +292,7 @@ static int decode_lt_rps(const HEVCSPS *sps, LongTermRPS *rps,
lt_idx_sps = get_bits(gb, av_ceil_log2(sps->num_long_term_ref_pics_sps));
rps->poc[i] = sps->lt_ref_pic_poc_lsb_sps[lt_idx_sps];
- rps->used[i] = !!(sps->used_by_curr_pic_lt & (1 << lt_idx_sps));
+ rps->used[i] = !!(sps->used_by_curr_pic_lt & (1U << lt_idx_sps));
} else {
rps->poc[i] = get_bits(gb, sps->log2_max_poc_lsb);
rps->used[i] = get_bits1(gb);