mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-27 09:52:17 +00:00
lavu/common.h: Fix UB in av_clip_intp2_c()
Found by value analysis
This commit is contained in:
parent
818a487849
commit
60ab40be70
@ -265,7 +265,7 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
|
||||
*/
|
||||
static av_always_inline av_const int av_clip_intp2_c(int a, int p)
|
||||
{
|
||||
if (((unsigned)a + (1 << p)) & ~((2 << p) - 1))
|
||||
if (((unsigned)a + (1U << p)) & ~((2U << p) - 1))
|
||||
return (a >> 31) ^ ((1 << p) - 1);
|
||||
else
|
||||
return a;
|
||||
|
Loading…
Reference in New Issue
Block a user