From 687d969c9c50be98597ee9f383280517f1f8cd97 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 19 Apr 2015 21:39:10 -0400 Subject: [PATCH] Noise: Correct noise objects created with invalid dimensions --- src/noise.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.25.1