From 2eea0461398476b7780468c3dfbfd8f2e0b57fd9 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 18 Nov 2015 01:29:55 +0400 Subject: [PATCH] (VawAudio.TryOpen): don't dispose intermediate stream on error. --- ArcFormats/BlackCyc/AudioVAW.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ArcFormats/BlackCyc/AudioVAW.cs b/ArcFormats/BlackCyc/AudioVAW.cs index 4f8963da..5010e565 100644 --- a/ArcFormats/BlackCyc/AudioVAW.cs +++ b/ArcFormats/BlackCyc/AudioVAW.cs @@ -74,17 +74,8 @@ namespace GameRes.Formats.BlackCyc } else return null; - var input = new StreamRegion (file, offset, file.Length-offset, true); - try - { - return format.TryOpen (input); - // FIXME file will be left undisposed - } - catch - { - input.Dispose(); - throw; - } + var input = new StreamRegion (file, offset, file.Length-offset); + return format.TryOpen (input); } public override void Write (SoundInput source, Stream output)