avutil/integer: Fix integer overflow in av_mul_i()

Found-by: fate
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3cc3cb663b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2018-10-24 01:44:12 +02:00
parent d2ce6472a7
commit b8aa7b9a6d
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
}