SDL
SDL copied to clipboard
SDL_GlobDirectory causes a crash in android
This snippet causes a crash in android, because the function doesn't return anything and I get a divide by zero error later down the line, but in windows and wasm it works fine
char** rawFiles = SDL_GlobDirectory("nameless_deity", "*.png", SDL_GLOB_CASEINSENSITIVE, nullptr);
std::vector<std::string> helper;
for (char** ptr = rawFiles; *ptr != nullptr; ++ptr)
{
helper.push_back(*ptr);
}
}
Certain filesystem and path functions on Android are not implemented. Where do you expect the directory search/glob to be performed in that case? Inside APK's assets/ folder, or somewhere on actual device filesystem (/data, /usr/)?
Assets directory would be nice, as sdl_load already uses that
This is the same problem as #13050 (SDL_GlobDirectory uses SDL_EnumerateDirectory and SDL_GetPathInfo under the hood).