Skip to content

Commit

Permalink
Fix segfault with invalid texture strings and minimap enabled
Browse files Browse the repository at this point in the history
closes #10949
  • Loading branch information
sfan5 committed Feb 14, 2021
1 parent 375bcd6 commit f018737
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client/tile.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit f018737

Please sign in to comment.