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>
(cherry picked from commit 35f3df0d76)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-05-06 00:13:05 +02:00
parent fb4a81dc3a
commit 1fe0de8934
1 changed files with 2 additions and 2 deletions

View File

@ -235,12 +235,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;