Skip to content

Commit

Permalink
Fix crash when detecting SIMD
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Nov 16, 2019
1 parent cf33f1f commit 2dab79b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cpuinfo/SDL_cpuinfo.c
Expand Up @@ -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);
Expand Down

0 comments on commit 2dab79b

Please sign in to comment.