aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/common.h
diff options
context:
space:
mode:
authorTomas Härdin <git@haerdin.se>2024-05-15 21:03:47 +0200
committerTomas Härdin <git@haerdin.se>2024-06-14 14:28:24 +0200
commit818a487849b9f8234275f800f78f318750dc7e6d (patch)
tree1b9157724b37efc4fe1093f60388e17e25f88046 /libavutil/common.h
parent6225ad5c19751ed55555ac9ffb738c2e4acc1f92 (diff)
downloadffmpeg-818a487849b9f8234275f800f78f318750dc7e6d.tar.gz
lavu/common.h: Fix UB in av_clipl_int32_c()
Found by value analysis
Diffstat (limited to 'libavutil/common.h')
-rw-r--r--libavutil/common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/common.h b/libavutil/common.h
index 1f5db42cb2..92b5d27ef1 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -253,8 +253,8 @@ 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);
- else return (int32_t)a;
+ if ((a+UINT64_C(0x80000000)) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF);
+ else return (int32_t)a;
}
/**