memory-safety improved

This commit is contained in:
A-lex-Ra
2023-12-18 18:02:17 +06:00
parent 779a8101fa
commit 6830205bcc
3 changed files with 59 additions and 32 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ bool assetload::atlas(Assets* assets,
if (builder.has(name)) {
continue; // skip duplicates
}
std::unique_ptr<ImageData> image (png::load_image(file.string()));
std::unique_ptr<ImageData> image (png::load_image(file.string()));//but what if load_image return nullptr?
image->fixAlphaColor();
builder.add(name, image.release());
}