mirror of
https://github.com/minetest/minetest.git
synced 2024-08-18 20:44:16 +02:00
Tile: Fix segfault caused by invalid PNG data
This commit is contained in:
parent
e66e583f5e
commit
847ed04e0a
@ -1869,6 +1869,11 @@ bool TextureSource::generateImagePart(std::string part_of_name,
|
||||
video::IImage* pngimg = vd->createImageFromFile(memfile);
|
||||
memfile->drop();
|
||||
|
||||
if (!pngimg) {
|
||||
errorstream << "generateImagePart(): Invalid PNG data" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (baseimg) {
|
||||
blitBaseImage(pngimg, baseimg);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user