diff --git a/Library/DiscUtils.Core/Compression/LzxDecoder.cs b/Library/DiscUtils.Core/Compression/LzxDecoder.cs index a66d8dd47..29308b85c 100644 --- a/Library/DiscUtils.Core/Compression/LzxDecoder.cs +++ b/Library/DiscUtils.Core/Compression/LzxDecoder.cs @@ -236,7 +236,7 @@ private bool DecodeUncompressedBlock( if ((blockSize & 1) != 0) { - if (!reader.TryReadRawByte(out _)) + if (remainingOutput - bytesToStore > 0 && !reader.TryReadRawByte(out _)) { return false; }