diff options
author | Mark Harris <mark.hsj@gmail.com> | 2016-07-22 07:22:22 +0300 |
---|---|---|
committer | Mark Harris <mark.hsj@gmail.com> | 2016-07-22 07:22:22 +0300 |
commit | d401961a1858c616fac95ffc8065539a47c3f2df (patch) | |
tree | 09e362918c20b5d1d21869558534a4ce511df9f0 /tests | |
parent | de473b305c6e18587ee3c205b313e75356e3f540 (diff) |
tests: Avoid shift into sign undefined behavior
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_opus_decode.c | 2 | ||||
-rw-r--r-- | tests/test_opus_encode.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_opus_decode.c b/tests/test_opus_decode.c index 9c0eb9c7..5ab16acc 100644 --- a/tests/test_opus_decode.c +++ b/tests/test_opus_decode.c @@ -436,7 +436,7 @@ int main(int _argc, char **_argv) iseed=atoi(env_seed); env_used=1; } - else iseed=(opus_uint32)time(NULL)^((getpid()&65535)<<16); + else iseed=(opus_uint32)time(NULL)^(((opus_uint32)getpid()&65535)<<16); Rw=Rz=iseed; oversion=opus_get_version_string(); diff --git a/tests/test_opus_encode.c b/tests/test_opus_encode.c index 132d074d..705e70bc 100644 --- a/tests/test_opus_encode.c +++ b/tests/test_opus_encode.c @@ -490,7 +490,7 @@ int main(int _argc, char **_argv) iseed=atoi(env_seed); env_used=1; } - else iseed=(opus_uint32)time(NULL)^((getpid()&65535)<<16); + else iseed=(opus_uint32)time(NULL)^(((opus_uint32)getpid()&65535)<<16); Rw=Rz=iseed; oversion=opus_get_version_string(); |