diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2020-11-20 01:51:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-20 02:51:59 +0100 |
| commit | 9852cb9c9ea3793eaef405ebb671052bb4b6643a (patch) | |
| tree | aee5994e441ea9f604454aaeb2e753d5b9df6c6b /ARMeilleure/Translation/PTC/Ptc.cs | |
| parent | c2356a7653d46ad2e3320dfd0f7816d63f8ff1a7 (diff) | |
Use backup when PTC compression is corrupt (#1704)
* Use backup when PTC compression is corrupt
* Apply suggestions from code review
Co-authored-by: LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>
Co-authored-by: LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>
Diffstat (limited to 'ARMeilleure/Translation/PTC/Ptc.cs')
| -rw-r--r-- | ARMeilleure/Translation/PTC/Ptc.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ARMeilleure/Translation/PTC/Ptc.cs b/ARMeilleure/Translation/PTC/Ptc.cs index 3baef401..c5cb123e 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); |
