[FFmpeg-cvslog] x86/motion_est: widen before multiply.

Michael Niedermayer git at videolan.org
Tue Oct 16 03:15:00 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Oct 16 03:09:28 2012 +0200| [9c669672c7fd45ef1cad782ab551be438ceac6cd] | committer: Michael Niedermayer

x86/motion_est: widen before multiply.

This fixes CID700558, CID700557, CID700556
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/x86/motion_est.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/x86/motion_est.c b/libavcodec/x86/motion_est.c
index b77d402..57f5df0 100644
--- a/libavcodec/x86/motion_est.c
+++ b/libavcodec/x86/motion_est.c
@@ -40,7 +40,7 @@ DECLARE_ASM_CONST(8, uint64_t, bone)= 0x0101010101010101LL;
 
 static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
 {
-    x86_reg len= -(stride*h);
+    x86_reg len= -(x86_reg)stride*h;
     __asm__ volatile(
         ".p2align 4                     \n\t"
         "1:                             \n\t"
@@ -199,7 +199,7 @@ static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
 
 static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
 {
-    x86_reg len= -(stride*h);
+    x86_reg len= -(x86_reg)stride*h;
     __asm__ volatile(
         ".p2align 4                     \n\t"
         "1:                             \n\t"
@@ -237,7 +237,7 @@ static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int
 
 static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
 {
-    x86_reg len= -(stride*h);
+    x86_reg len= -(x86_reg)stride*h;
     __asm__ volatile(
         "movq (%1, %%"REG_a"), %%mm0    \n\t"
         "movq 1(%1, %%"REG_a"), %%mm2   \n\t"



More information about the ffmpeg-cvslog mailing list