On tracing it turns out to fail from SDL_WM_SetCaption() On going through the function it looks like the SDL_free() function is called every alternate time with an invalid pointer that has already been freed.
The OpenGL renderer works without changes, yay! :)