mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
lavu/common.h: Fix UB in av_clip_uintp2_c()
Found by value analysis
This commit is contained in:
parent
60ab40be70
commit
3b9e457647
@ -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