From 5cf483d5bf7f08391de3e887370fa6c3a359c3af Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Tue, 1 Jan 2019 20:57:28 -0500 Subject: [PATCH] x_res, y_res and z_res are now verified to be multiples of 16 --- src/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index a3034f1..6f6af5b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -232,6 +232,15 @@ int main(int argc, char** argv) x_res = std::stoi(std::string(argv[3])); y_res = std::stoi(std::string(argv[4])); z_res = std::stoi(std::string(argv[5])); + + // Make sure that x_res, y_res and z_res are multiples of 16. + + if (x_res % 16 != 0 || y_res % 16 != 0 || z_res % 16 != 0) + { + std::cout << "x_res, y_res and z_res must be multiples of 16." << std::endl; + + exit(17); + } } else { @@ -317,6 +326,15 @@ int main(int argc, char** argv) x_res = std::stoi(std::string(argv[2])); y_res = std::stoi(std::string(argv[3])); z_res = std::stoi(std::string(argv[4])); + + // Make sure that x_res, y_res and z_res are multiples of 16. + + if (x_res % 16 != 0 || y_res % 16 != 0 || z_res % 16 != 0) + { + std::cout << "x_res, y_res and z_res must be multiples of 16." << std::endl; + + exit(17); + } } else {