fix a segfault when saving null images
This commit is contained in:
parent
83e1b59b78
commit
14d49d3267
1 changed files with 3 additions and 0 deletions
|
@ -1263,6 +1263,9 @@ bool save_image(const locator & i_locator, const std::string & filename)
|
||||||
|
|
||||||
bool save_image(const surface & surf, const std::string & filename)
|
bool save_image(const surface & surf, const std::string & filename)
|
||||||
{
|
{
|
||||||
|
if (surf.null()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#ifdef HAVE_LIBPNG
|
#ifdef HAVE_LIBPNG
|
||||||
if (!filesystem::ends_with(filename, ".bmp")) {
|
if (!filesystem::ends_with(filename, ".bmp")) {
|
||||||
LOG_DP << "Writing a png image to " << filename << std::endl;
|
LOG_DP << "Writing a png image to " << filename << std::endl;
|
||||||
|
|
Loading…
Add table
Reference in a new issue