aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/common.h
diff options
context:
space:
mode:
authorTomas Härdin <git@haerdin.se>2024-05-16 16:37:58 +0200
committerTomas Härdin <git@haerdin.se>2024-06-14 14:28:25 +0200
commit3b9e457647a3c8554e32edf2e2effb11280ddda7 (patch)
treefef8097c6ba9b3e8f7efa070f030ff760d2c3eae /libavutil/common.h
parent60ab40be7086ad80418192a3eaf2f2b860c10369 (diff)
downloadffmpeg-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.h4
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;
}
/**