--Bug fixes

-Stop rendering process when a single render or save fails.
This commit is contained in:
Person
2023-11-04 19:02:22 -06:00
parent 99d1096b51
commit 1a1cb8b0f2
4 changed files with 31 additions and 20 deletions

View File

@ -116,7 +116,8 @@ static bool WriteJpeg(const char* filename, unsigned char* image, size_t width,
jpeg_destroy_compress(&info);
if (file != nullptr)
fclose(file);
if (fclose(file))//Non-zero indicates failure.
return false;
b = true;
}
@ -225,7 +226,8 @@ static bool WritePng(const char* filename, unsigned char* image, size_t width, s
png_destroy_write_struct(&png_ptr, &info_ptr);
if (file != nullptr)
fclose(file);
if (fclose(file))
return false;
b = true;
}