SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Android SDL_CreateSurface with massive w & h bombs horribly

Open AntTheAlchemist opened this issue 1 year ago • 0 comments

Let's say we call SDL_CalculateSurfaceSize(16386, 16386, SDL_PIXELFORMAT_RGBA128_FLOAT);, it will pass the SDL_CalculateSurfaceSize check on Android, and when memset is used to clear the pixels, the Android system goes nuts on onTrimMemory, but the native event doesn't get the chance to be handled - not that it can do anything. The app just bombs. Can something be done to catch this and return a graceful error? Windows (32-bit) catches this size allocation at SDL_CalculateSurfaceSize - haven't tested 64-bit.

AntTheAlchemist avatar Nov 05 '24 02:11 AntTheAlchemist