mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix segfault with invalid texture strings and minimap enabled
closes #10949
This commit is contained in:
parent
375bcd65c1
commit
f018737b06
1 changed files with 5 additions and 0 deletions
|
@ -2224,9 +2224,14 @@ video::SColor TextureSource::getTextureAverageColor(const std::string &name)
|
|||
video::IVideoDriver *driver = RenderingEngine::get_video_driver();
|
||||
video::SColor c(0, 0, 0, 0);
|
||||
video::ITexture *texture = getTexture(name);
|
||||
if (!texture)
|
||||
return c;
|
||||
video::IImage *image = driver->createImage(texture,
|
||||
core::position2d<s32>(0, 0),
|
||||
texture->getOriginalSize());
|
||||
if (!image)
|
||||
return c;
|
||||
|
||||
u32 total = 0;
|
||||
u32 tR = 0;
|
||||
u32 tG = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue