mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 00:51:37 +00:00
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:
parent
90e108a2e9
commit
c717e525ba
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user