~ubuntu-branches/ubuntu/raring/libav/raring-security

« back to all changes in this revision

Viewing changes to debian/patches/post-0.7.1/0040-cpu-detection-avoid-a-signed-overflow.patch

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2011-10-01 00:22:07 UTC
  • mfrom: (1.3.8 sid)
  • Revision ID: package-import@ubuntu.com-20111001002207-tnxz39i0rwr5ufy9
Tags: 4:0.7.2-1ubuntu1
* Merge from debian, remaining changes:
  - don't build against libfaad, libdirac, librtmp and libopenjpeg,
    lame, xvid, x264  (all in universe)
  - not installing into multiarch directories
* This new upstream release has basically merged in all 70 patches that
  are present in 4:0.7.1-7ubuntu2, plus some additional, similarily
  focused ones.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 
6
 
1<<31 overflows because 1 is signed, so force it to unsigned.
7
 
 
8
 
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
9
 
(cherry picked from commit 5938e02185430ca711106aaec9b5622dbf588af3)
10
 
 
11
 
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12
 
---
13
 
 libavutil/x86/cpu.c |    2 +-
14
 
 1 files changed, 1 insertions(+), 1 deletions(-)
15
 
 
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)
21
 
 
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;
29
 
1.7.4.1
30