mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
memory-safety improved
This commit is contained in:
parent
779a8101fa
commit
6830205bcc
3 changed files with 59 additions and 32 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue