aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-03-25 05:27:08 -0300
committerMichael Niedermayer <michaelni@gmx.at>2014-03-27 11:20:56 +0100
commit1103aec1df38df79abe2c2689818ca295383d9ed (patch)
tree180f82f6e3d65d49b57d547cb2c05f59dfee06b3
parentb40ab81d1f547057c563c6cc0fab106facc808fe (diff)
downloadffmpeg-1103aec1df38df79abe2c2689818ca295383d9ed.tar.gz
x86/cpu: check for OS support before enabling AVX2
AV_CPU_FLAG_AVX is enabled at this point only if there's OS support. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 2d9821a2081aff5dca253386c6e7e71a04509cff) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/x86/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
index 356cd44f06..8ad478400c 100644
--- a/libavutil/x86/cpu.c
+++ b/libavutil/x86/cpu.c
@@ -143,7 +143,7 @@ int ff_get_cpu_flags_x86(void)
if (max_std_level >= 7) {
cpuid(7, eax, ebx, ecx, edx);
#if HAVE_AVX2
- if (ebx & 0x00000020)
+ if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020))
rval |= AV_CPU_FLAG_AVX2;
#endif /* HAVE_AVX2 */
/* BMI1/2 don't need OS support */