mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 22:52:25 +01:00
Client: fix possible division by zero in [crack modifier
This commit is contained in:
parent
dd094d7606
commit
ed7d4037b2
@ -2467,6 +2467,10 @@ video::IImage *create_crack_image(video::IImage *crack, s32 frame_index,
|
||||
core::dimension2d<u32> size, u8 tiles, video::IVideoDriver *driver)
|
||||
{
|
||||
core::dimension2d<u32> strip_size = crack->getDimension();
|
||||
|
||||
if (tiles == 0 || strip_size.getArea() == 0)
|
||||
return nullptr;
|
||||
|
||||
core::dimension2d<u32> frame_size(strip_size.Width, strip_size.Width);
|
||||
core::dimension2d<u32> tile_size(size / tiles);
|
||||
s32 frame_count = strip_size.Height / strip_size.Width;
|
||||
|
Loading…
Reference in New Issue
Block a user