libFLAC/cpu.c: Fix CPU detecton
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 2 Jan 2017 17:46:20 +0000 (04:46 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 2 Jan 2017 17:46:24 +0000 (04:46 +1100)
Patch-from: Janne Hyv√§rinen <cse@sci.fi>

src/libFLAC/cpu.c

index b9df19a..808d55d 100644 (file)
@@ -269,9 +269,9 @@ void FLAC__cpu_info_x86(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx
        __cpuid(cpuinfo, ext);
        if((unsigned)cpuinfo[0] >= level) {
 #if FLAC__AVX_SUPPORTED
-               __cpuidex(cpuinfo, ext, 0); /* for AVX2 detection */
+               __cpuidex(cpuinfo, level, 0); /* for AVX2 detection */
 #else
-               __cpuid(cpuinfo, ext); /* some old compilers don't support __cpuidex */
+               __cpuid(cpuinfo, level); /* some old compilers don't support __cpuidex */
 #endif
 
                *eax = cpuinfo[0]; *ebx = cpuinfo[1]; *ecx = cpuinfo[2]; *edx = cpuinfo[3];