Fix crash when detecting SIMD

This commit is contained in:
Sylvain Becker 2019-11-16 22:55:36 +01:00
parent cf33f1f0ef
commit 2dab79bcc2
1 changed files with 4 additions and 2 deletions

View File

@ -362,8 +362,10 @@ CPU_haveARMSIMD(void)
if (aux.a_type == AT_PLATFORM)
{
const char *plat = (const char *) aux.a_un.a_val;
arm_simd = strncmp(plat, "v6l", 3) == 0 ||
strncmp(plat, "v7l", 3) == 0;
if (plat) {
arm_simd = strncmp(plat, "v6l", 3) == 0 ||
strncmp(plat, "v7l", 3) == 0;
}
}
}
close(fd);