From 6613f11461a120c98123e439f56e97d970edca66 Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 12 Dec 2015 18:18:10 +0400 Subject: [PATCH] (Pb3Reader.Unpack): throw InvalidEncryptionScheme on unknown type id. --- ArcFormats/Cmvs/ImagePB3.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ArcFormats/Cmvs/ImagePB3.cs b/ArcFormats/Cmvs/ImagePB3.cs index bbea7ce4..5be56d14 100644 --- a/ArcFormats/Cmvs/ImagePB3.cs +++ b/ArcFormats/Cmvs/ImagePB3.cs @@ -113,11 +113,15 @@ namespace GameRes.Formats.Purple { switch (m_info.Type) { + default: throw new InvalidEncryptionScheme(); case 1: UnpackV1(); break; case 5: UnpackV5(); break; case 8: case 6: UnpackV6(); break; - default: throw new NotSupportedException(string.Format ("PB3 v{0} images not supported", m_info.Type)); + case 2: + case 3: + case 4: + case 7: throw new NotSupportedException(string.Format ("PB3 v{0} images not supported", m_info.Type)); // V3 is pain in the ass to implement, machine code is full of unrolled loops resulting in a // thousands lines of spaghetti code. }