diff options
author | Rodger Combs <rodger.combs@gmail.com> | 2015-07-27 17:53:21 -0500 |
---|---|---|
committer | Rodger Combs <rodger.combs@gmail.com> | 2015-07-27 17:53:21 -0500 |
commit | dc78d6a0ce5a95a112b96d3b029172bb64d83252 (patch) | |
tree | 1ff4073f158b819b2881970d97539e06b04d4120 /libass/ass_utils.c | |
parent | d787615845d78d8f8e6d1a4ffc3dc3eecd8a92f6 (diff) | |
download | libass-dc78d6a0ce5a95a112b96d3b029172bb64d83252.tar.bz2 libass-dc78d6a0ce5a95a112b96d3b029172bb64d83252.tar.xz |
Fix crash when the OS doesn't support AVX2
Diffstat (limited to 'libass/ass_utils.c')
-rw-r--r-- | libass/ass_utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libass/ass_utils.c b/libass/ass_utils.c index a6a063b..94edf80 100644 --- a/libass/ass_utils.c +++ b/libass/ass_utils.c @@ -48,6 +48,9 @@ int has_avx(void) if(!(ecx & (1 << 27))) // not OSXSAVE return 0; uint32_t misc = ecx; + ass_get_xgetbv(0, &eax, &edx); + if((eax & 0x6) != 0x6) + return 0; eax = 0; ass_get_cpuid(&eax, &ebx, &ecx, &edx); return (ecx & 0x6) == 0x6 ? (misc >> 28) & 0x1 : 0; // check high bits are relevant, then AVX support |