diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c index 70962dda0..0e5728ad3 100644 --- a/src/stdlib/SDL_qsort.c +++ b/src/stdlib/SDL_qsort.c @@ -30,6 +30,9 @@ #if defined(HAVE_QSORT) void SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)) { + if (!base) { + return; + } qsort(base, nmemb, size, compare); }