1
From 1cf3ba89711748b340c31fe018a3a72e8e9b75f1 Mon Sep 17 00:00:00 2001
2
From: Sean McGovern <gseanmcg@gmail.com>
3
Date: Mon, 25 Jul 2011 18:51:02 -0400
4
Subject: [PATCH 40/70] cpu detection: avoid a signed overflow
6
1<<31 overflows because 1 is signed, so force it to unsigned.
8
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
9
(cherry picked from commit 5938e02185430ca711106aaec9b5622dbf588af3)
11
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13
libavutil/x86/cpu.c | 2 +-
14
1 files changed, 1 insertions(+), 1 deletions(-)
16
diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
17
index 78aeadf..f747e4d 100644
18
--- a/libavutil/x86/cpu.c
19
+++ b/libavutil/x86/cpu.c
20
@@ -113,7 +113,7 @@ int ff_get_cpu_flags_x86(void)
22
if(max_ext_level >= 0x80000001){
23
cpuid(0x80000001, eax, ebx, ecx, ext_caps);
24
- if (ext_caps & (1<<31))
25
+ if (ext_caps & (1U<<31))
26
rval |= AV_CPU_FLAG_3DNOW;
27
if (ext_caps & (1<<30))
28
rval |= AV_CPU_FLAG_3DNOWEXT;