diff --git a/ARMeilleure/Translation/PTC/Ptc.cs b/ARMeilleure/Translation/PTC/Ptc.cs index 3baef401a6..c5cb123e44 100644 --- a/ARMeilleure/Translation/PTC/Ptc.cs +++ b/ARMeilleure/Translation/PTC/Ptc.cs @@ -196,7 +196,16 @@ namespace ARMeilleure.Translation.PTC { int hashSize = md5.HashSize / 8; - deflateStream.CopyTo(stream); + try + { + deflateStream.CopyTo(stream); + } + catch + { + InvalidateCompressedStream(compressedStream); + + return false; + } stream.Seek(0L, SeekOrigin.Begin); diff --git a/ARMeilleure/Translation/PTC/PtcProfiler.cs b/ARMeilleure/Translation/PTC/PtcProfiler.cs index dcc312750b..dbb3ed9d10 100644 --- a/ARMeilleure/Translation/PTC/PtcProfiler.cs +++ b/ARMeilleure/Translation/PTC/PtcProfiler.cs @@ -120,7 +120,16 @@ namespace ARMeilleure.Translation.PTC { int hashSize = md5.HashSize / 8; - deflateStream.CopyTo(stream); + try + { + deflateStream.CopyTo(stream); + } + catch + { + InvalidateCompressedStream(compressedStream); + + return false; + } stream.Seek(0L, SeekOrigin.Begin); @@ -264,4 +273,4 @@ namespace ARMeilleure.Translation.PTC } } } -} \ No newline at end of file +}