[FFmpeg-cvslog] cpu detection: avoid a signed overflow

Sean McGovern git at videolan.org
Sun Dec 25 01:35:59 CET 2011


ffmpeg | branch: release/0.6 | Sean McGovern <gseanmcg at gmail.com> | Mon Jul 25 18:51:02 2011 -0400| [4ccb8f5b7b99ebaab5032f0d1b2b42906e3a14c5] | committer: Reinhard Tartler

cpu detection: avoid a signed overflow

1<<31 overflows because 1 is signed, so force it to unsigned.

Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>
(cherry picked from commit 5938e02185430ca711106aaec9b5622dbf588af3)

Signed-off-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: Reinhard Tartler <siretart at tauware.de>

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

 libavcodec/x86/cpuid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/x86/cpuid.c b/libavcodec/x86/cpuid.c
index 1ed4d2e..832b990 100644
--- a/libavcodec/x86/cpuid.c
+++ b/libavcodec/x86/cpuid.c
@@ -98,7 +98,7 @@ int mm_support(void)
 
     if(max_ext_level >= 0x80000001){
         cpuid(0x80000001, eax, ebx, ecx, ext_caps);
-        if (ext_caps & (1<<31))
+        if (ext_caps & (1U<<31))
             rval |= FF_MM_3DNOW;
         if (ext_caps & (1<<30))
             rval |= FF_MM_3DNOWEXT;



More information about the ffmpeg-cvslog mailing list