Although this is rather a theoretical problem, I want to inform you about some observations I've made. The following code fails with a STL debug assertion (VS 2010):
#include <SFML/Graphics/Image.hpp>
int main()
{
sf::Image image;
image.SaveToFile("image.bmp");
}
The problem is the statement &pixels[0] in ImageLoader.cpp. As far as I know, if you access the 0th element of an empty std::vector, you evoke undefined behaviour.
There are a few other places (also in Image.cpp) where the access is unchecked. In some of them, you could handle it like in Image::CreateMaskFromColor():
if (myPixels.empty())
return;
But I don't know if there is a convention how to represent empty image files. Anyway, you should probably make the semantics clearer or explicitly forbid some operations on singular sf::Image instances.