[FFmpeg-cvslog] avutil/integer: Fix integer overflow in av_mul_i()

Michael Niedermayer git at videolan.org
Thu Oct 25 00:15:54 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Oct 24 01:44:12 2018 +0200| [3cc3cb663bf3061e40356392d2f7638de6a479fe] | committer: Michael Niedermayer

avutil/integer: Fix integer overflow in av_mul_i()

Found-by: fate
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3cc3cb663bf3061e40356392d2f7638de6a479fe
---

 libavutil/integer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



More information about the ffmpeg-cvslog mailing list