mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 23:22:24 +01: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);
|
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…
Reference in New Issue
Block a user