From 2dab79bcc2b6e9c3cbd65ede1108651c7c9bef1f Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Sat, 16 Nov 2019 22:55:36 +0100 Subject: [PATCH] Fix crash when detecting SIMD --- src/cpuinfo/SDL_cpuinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index 2916e34e9..a40fe7f31 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -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);