1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

lavu/common.h: Fix UB in av_clip_uintp2_c()

Found by value analysis
This commit is contained in:
Tomas Härdin 2024-05-16 16:37:58 +02:00
parent 60ab40be70
commit 3b9e457647

View File

@ -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) 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); if (a & ~((1U<<p) - 1)) return (~a) >> 31 & ((1U<<p) - 1);
else return a; else return a;
} }
/** /**