- if (backbuffer == NULL ||
- backbuffer->surface == NULL)
- return SDL_ConvertSurface(surface, surface->format, 0);
+ if (backbuffer && backbuffer->surface)
+ new_surface = SDL_ConvertSurface(surface, backbuffer->surface->format, 0);
+ else
+ new_surface = SDL_ConvertSurface(surface, surface->format, 0);
+
+ if (new_surface == NULL)
+ Error(ERR_EXIT, "SDL_ConvertSurface() failed: %s", SDL_GetError());