From 7eee1c0f8f022cc1718e4bc770bfb3ef4238f958 Mon Sep 17 00:00:00 2001 From: Asnivor Date: Thu, 26 Oct 2017 17:19:47 +0100 Subject: [PATCH] DiscSystem MDS: version check --- BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs b/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs index 59ba49d5a5..27699da2d1 100644 --- a/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs +++ b/BizHawk.Emulation.DiscSystem/DiscFormats/MDS_Format.cs @@ -309,6 +309,14 @@ namespace BizHawk.Emulation.DiscSystem // parse header aFile.Header = aFile.Header.Parse(stream); + // check version to make sure this is only v1.x + // currently NO support for version 2.x + + if (aFile.Header.Version[0] > 1) + { + throw new MDSParseException("MDS Parse Error: Only MDS version 1.x is supported!\nDetected version: " + aFile.Header.Version[0] + "." + aFile.Header.Version[1]); + } + // parse sessions Dictionary aSessions = new Dictionary();