Are you sure that SDL_DisplayFormat(t_sfc) returns a pointer value? Maybe check to see if it's NULL?