summaryrefslogtreecommitdiff
path: root/libavcodec/lossless_audiodsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-16 13:14:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-06-06 02:24:22 +0200
commitbacc4b6e8173fa944c24f297435dc507a60efb10 (patch)
tree1e383d29b179794842bc27a2f240bbd5fb03a003 /libavcodec/lossless_audiodsp.c
parent5a8b41b4a76fc6586ff6afff78e5f0aa7b25068a (diff)
downloadffmpeg-bacc4b6e8173fa944c24f297435dc507a60efb10.tar.gz
avcodec/wmalosslessdec: Use unsigned operations for overflowing cases
Fixes undefined behavior in fate-lossless-wma24-2 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/lossless_audiodsp.c')
-rw-r--r--libavcodec/lossless_audiodsp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/lossless_audiodsp.c b/libavcodec/lossless_audiodsp.c
index e3ea8e188c..3a9f9b20bb 100644
--- a/libavcodec/lossless_audiodsp.c
+++ b/libavcodec/lossless_audiodsp.c
@@ -45,9 +45,9 @@ static int32_t scalarproduct_and_madd_int32_c(int16_t *v1, const int32_t *v2,
int res = 0;
do {
- res += *v1 * *v2++;
+ res += *v1 * (uint32_t)*v2++;
*v1++ += mul * *v3++;
- res += *v1 * *v2++;
+ res += *v1 * (uint32_t)*v2++;
*v1++ += mul * *v3++;
} while (order-=2);
return res;