aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-06 00:13:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-06 00:33:19 +0200
commit35f3df0d76e28969fa77f2b865e2e40b3ba69722 (patch)
tree819cf5a1c43621e12b1eaa1117532b0ba41d9765
parent12dea8a5a15343e9c404376c40ca8a1cc9d1479e (diff)
downloadffmpeg-35f3df0d76e28969fa77f2b865e2e40b3ba69722.tar.gz
avutil/softfloat: Fix multiple runtime error: left shift of negative value -8
Fixes: 1352/clusterfuzz-testcase-minimized-5757565017260032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavutil/softfloat.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index e6d30ad333..5d376e438a 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -234,12 +234,12 @@ static av_unused void av_sincos_sf(int a, int *s, int *c)
int st, ct;
idx = a >> 26;
- sign = (idx << 27) >> 31;
+ sign = (int32_t)((unsigned)idx << 27) >> 31;
cv = av_costbl_1_sf[idx & 0xf];
cv = (cv ^ sign) - sign;
idx -= 8;
- sign = (idx << 27) >> 31;
+ sign = (int32_t)((unsigned)idx << 27) >> 31;
sv = av_costbl_1_sf[idx & 0xf];
sv = (sv ^ sign) - sign;