mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 17:54:25 +00:00
lavu/common.h: Fix UB in av_clipl_int32_c()
Found by value analysis Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
ecef34a7c2
commit
ef6ea6e31a
@ -253,7 +253,7 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a)
|
||||
*/
|
||||
static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
|
||||
{
|
||||
if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF);
|
||||
if ((a+UINT64_C(0x80000000)) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF);
|
||||
else return (int32_t)a;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user