diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-25 20:55:02 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-25 20:56:00 +0100 |
commit | 6d66e1a1136d7a720f370556852c8b5ed0abdfea (patch) | |
tree | 0da1fc452d0bb55b73c1f6b329852652f62858af /libavutil/common.h | |
parent | 63ca0fe8288dbd300c9bb814cb671e5d889f691c (diff) | |
download | ffmpeg-6d66e1a1136d7a720f370556852c8b5ed0abdfea.tar.gz |
avutil/common: Fix integer overflow in av_clip_int8/16_c
Fixes: signal_sigsegv_30420a5_2388_cov_1489993561_integra_lavf.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/common.h')
-rw-r--r-- | libavutil/common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index 3675a6cdf0..2fca6934c7 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -147,7 +147,7 @@ static av_always_inline av_const uint8_t av_clip_uint8_c(int a) */ static av_always_inline av_const int8_t av_clip_int8_c(int a) { - if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F; + if ((a+0x80U) & ~0xFF) return (a>>31) ^ 0x7F; else return a; } @@ -169,7 +169,7 @@ static av_always_inline av_const uint16_t av_clip_uint16_c(int a) */ static av_always_inline av_const int16_t av_clip_int16_c(int a) { - if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF; + if ((a+0x8000U) & ~0xFFFF) return (a>>31) ^ 0x7FFF; else return a; } |