diff options
author | Tomas Härdin <git@haerdin.se> | 2024-05-16 16:37:58 +0200 |
---|---|---|
committer | Tomas Härdin <git@haerdin.se> | 2024-06-14 14:28:25 +0200 |
commit | 3b9e457647a3c8554e32edf2e2effb11280ddda7 (patch) | |
tree | fef8097c6ba9b3e8f7efa070f030ff760d2c3eae /libavutil/common.h | |
parent | 60ab40be7086ad80418192a3eaf2f2b860c10369 (diff) | |
download | ffmpeg-3b9e457647a3c8554e32edf2e2effb11280ddda7.tar.gz |
lavu/common.h: Fix UB in av_clip_uintp2_c()
Found by value analysis
Diffstat (limited to 'libavutil/common.h')
-rw-r--r-- | libavutil/common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index 29cef74826..3b830daf30 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -279,8 +279,8 @@ static av_always_inline av_const int av_clip_intp2_c(int a, int p) */ static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) { - if (a & ~((1<<p) - 1)) return (~a) >> 31 & ((1<<p) - 1); - else return a; + if (a & ~((1U<<p) - 1)) return (~a) >> 31 & ((1U<<p) - 1); + else return a; } /** |