summaryrefslogtreecommitdiff
path: root/libswresample
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-29 16:06:31 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:58 +0100
commit9f895e984b9238727bd442c7c3bba97b0268d2ca (patch)
tree3c21d47bd4d25850b3dc9db862ce1fe107aa9f2b /libswresample
parent62dc4c2df500e1564a88f75bd402e09e5c205817 (diff)
downloadffmpeg-9f895e984b9238727bd442c7c3bba97b0268d2ca.tar.gz
swresample/audioconvert: Fix left shift of negative value
Fixes ticket #8219. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 9d8f9b2e4094ae6b07a9f23ae044b802722b3b4e)
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/audioconvert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c
index d21fc8ef42..89ee7bfae3 100644
--- a/libswresample/audioconvert.c
+++ b/libswresample/audioconvert.c
@@ -59,7 +59,7 @@ CONV_FUNC(AV_SAMPLE_FMT_FLT, float , AV_SAMPLE_FMT_U8 , (*(const uint8_t*)pi -
CONV_FUNC(AV_SAMPLE_FMT_DBL, double , AV_SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)*(1.0 / (1<<7)))
CONV_FUNC(AV_SAMPLE_FMT_U8 , uint8_t, AV_SAMPLE_FMT_S16, (*(const int16_t*)pi>>8) + 0x80)
CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_S16, *(const int16_t*)pi)
-CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_S16, *(const int16_t*)pi<<16)
+CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_S16, *(const int16_t*)pi * (1 << 16))
CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S16, (uint64_t)(*(const int16_t*)pi)<<48)
CONV_FUNC(AV_SAMPLE_FMT_FLT, float , AV_SAMPLE_FMT_S16, *(const int16_t*)pi*(1.0f/ (1<<15)))
CONV_FUNC(AV_SAMPLE_FMT_DBL, double , AV_SAMPLE_FMT_S16, *(const int16_t*)pi*(1.0 / (1<<15)))