aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-04-19 21:39:10 -0400
committerkwolekr <kwolekr@minetest.net>2015-04-19 21:39:10 -0400
commit687d969c9c50be98597ee9f383280517f1f8cd97 (patch)
tree486a2d8a8014278469bc6e099a1cffcb993bac11 /src
parent386d69533095a6f36d5c3a98f2cd8de20a0132d4 (diff)
downloadminetest-687d969c9c50be98597ee9f383280517f1f8cd97.tar.gz
minetest-687d969c9c50be98597ee9f383280517f1f8cd97.tar.bz2
minetest-687d969c9c50be98597ee9f383280517f1f8cd97.zip
Noise: Correct noise objects created with invalid dimensions
Diffstat (limited to 'src')
-rw-r--r--src/noise.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/noise.cpp b/src/noise.cpp
index bb7c9969e..9852a1524 100644
--- a/src/noise.cpp
+++ b/src/noise.cpp
@@ -485,6 +485,13 @@ Noise::~Noise()
void Noise::allocBuffers()
{
+ if (sx < 1)
+ sx = 1;
+ if (sy < 1)
+ sy = 1;
+ if (sz < 1)
+ sz = 1;
+
this->noise_buf = NULL;
resizeNoiseBuf(sz > 1);