projectM-visualizer / frontend-sdl-cpp

Standalone application based on libSDL that turns your desktop audio into awesome visuals. Available on most platforms supported by both libprojectM and libSDL.
GNU General Public License v3.0
66 stars 35 forks source link

ProjectMWrapper::initialize() doesn't check for NULL pointer after creating the projectM instance #66

Closed kblaschke closed 7 months ago

kblaschke commented 11 months ago

In the ProjectMWrapper::initialize() function, the returned projectM handle is not properly checked. Since projectm_create() will return a NULL pointer in the case the proejctM initializer throws an exception, this would then crash the application.

While the application still needs to exit if projectM couldn't be initialized, it should do so in an ordered manner instead of crashing.

kblaschke commented 7 months ago

This is now properly checked, logging a proper error and exiting nicely instead of crashing.