mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Tile: Fix segfault caused by invalid PNG data
This commit is contained in:
parent
e66e583f5e
commit
847ed04e0a
1 changed files with 5 additions and 0 deletions
|
@ -1869,6 +1869,11 @@ bool TextureSource::generateImagePart(std::string part_of_name,
|
||||||
video::IImage* pngimg = vd->createImageFromFile(memfile);
|
video::IImage* pngimg = vd->createImageFromFile(memfile);
|
||||||
memfile->drop();
|
memfile->drop();
|
||||||
|
|
||||||
|
if (!pngimg) {
|
||||||
|
errorstream << "generateImagePart(): Invalid PNG data" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (baseimg) {
|
if (baseimg) {
|
||||||
blitBaseImage(pngimg, baseimg);
|
blitBaseImage(pngimg, baseimg);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue