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

Found by value analysis

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Tomas Härdin 2024-05-16 16:37:58 +02:00 committed by Paul B Mahol
parent 90e108a2e9
commit c717e525ba

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)
{
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;
}
/**