aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-10-24 01:44:12 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-11-03 00:50:15 +0100
commitb8aa7b9a6d8618cf8997f20602be11a2c31c83d6 (patch)
tree4244d9b30bd3a97caf20f1b02de0ae471dfeb507
parentd2ce6472a77abd1653306ec5645a09b4c62add1b (diff)
downloadffmpeg-b8aa7b9a6d8618cf8997f20602be11a2c31c83d6.tar.gz
avutil/integer: Fix integer overflow in av_mul_i()
Found-by: fate Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3cc3cb663bf3061e40356392d2f7638de6a479fe) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavutil/integer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/integer.c b/libavutil/integer.c
index 890e314dce..78e252fbde 100644
--- a/libavutil/integer.c
+++ b/libavutil/integer.c
@@ -74,7 +74,7 @@ AVInteger av_mul_i(AVInteger a, AVInteger b){
if(a.v[i])
for(j=i; j<AV_INTEGER_SIZE && j-i<=nb; j++){
- carry= (carry>>16) + out.v[j] + a.v[i]*b.v[j-i];
+ carry= (carry>>16) + out.v[j] + a.v[i]*(unsigned)b.v[j-i];
out.v[j]= carry;
}
}