VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-30 22:58:55 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-30 23:56:32 (GMT)
commitf5e6136830b4c1e02327d1767030181364651e40 (patch)
tree6f6e8d81a373a92d5ecd7d92ee31accfc2a59448 /src/Crypto
parent33bb507fdeb0ca01725ad76f70dc00a7c154ed13 (diff)
downloadVeraCrypt-f5e6136830b4c1e02327d1767030181364651e40.zip
VeraCrypt-f5e6136830b4c1e02327d1767030181364651e40.tar.gz
For code logic clarity, add check for xgetbv support in CPU before using it.
Diffstat (limited to 'src/Crypto')
-rw-r--r--src/Crypto/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Crypto/cpu.c b/src/Crypto/cpu.c
index a9c6e92..7ec5b98 100644
--- a/src/Crypto/cpu.c
+++ b/src/Crypto/cpu.c
@@ -305,7 +305,7 @@ void DetectX86Features()
g_hasMMX = (cpuid1[3] & (1 << 23)) != 0;
if ((cpuid1[3] & (1 << 26)) != 0)
g_hasSSE2 = TrySSE2();
- if (g_hasSSE2 && (cpuid1[2] & (1 << 28)) && (cpuid1[2] & (1 << 27))) /* CPU has AVX and OS supports XSAVE/XRSTORE */
+ if (g_hasSSE2 && (cpuid1[2] & (1 << 28)) && (cpuid1[2] & (1 << 27)) && (cpuid1[2] & (1 << 26))) /* CPU has AVX and OS supports XSAVE/XRSTORE */
{
uint64 xcrFeatureMask = xgetbv();
g_hasAVX = (xcrFeatureMask & 0x6) == 0x6;