Noise: Correct noise objects created with invalid dimensions
authorkwolekr <kwolekr@minetest.net>
Mon, 20 Apr 2015 01:39:10 +0000 (21:39 -0400)
committerkwolekr <kwolekr@minetest.net>
Mon, 20 Apr 2015 01:39:10 +0000 (21:39 -0400)
src/noise.cpp

index bb7c9969e1574f399fa40ca090e08fa2701a373b..9852a1524612c3b6cd21c1787f82362f3e722efa 100644 (file)
@@ -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);