From 5f0b4d8da5a852774a18f85707c064665974b701 Mon Sep 17 00:00:00 2001 From: Silent Date: Sun, 23 Jun 2019 20:32:32 +0200 Subject: [PATCH] Fix a crash in DSPTool on malformed command line --- Source/DSPTool/DSPTool.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Source/DSPTool/DSPTool.cpp b/Source/DSPTool/DSPTool.cpp index 618c97e7af..f1434fd03e 100644 --- a/Source/DSPTool/DSPTool.cpp +++ b/Source/DSPTool/DSPTool.cpp @@ -400,21 +400,39 @@ int main(int argc, const char* argv[]) { const std::string argument = argv[i]; if (argument == "-d") + { disassemble = true; + } else if (argument == "-o") - output_name = argv[++i]; + { + if (++i < argc) + output_name = argv[i]; + } else if (argument == "-h") - output_header_name = argv[++i]; + { + if (++i < argc) + output_header_name = argv[i]; + } else if (argument == "-c") + { compare = true; + } else if (argument == "-s") + { outputSize = true; + } else if (argument == "-m") + { multiple = true; + } else if (argument == "-f") + { force = true; + } else if (argument == "-p") + { print_results = true; + } else if (argument == "-ps") { print_results = true;