@@ -795,10 +795,14 @@ @throw [OFNotOpenException exceptionWithObject: self]; if (_atEndOfStream) return 0; + if ([_stream isAtEndOfStream] && + ![_decompressedStream hasDataInReadBuffer]) + @throw [OFTruncatedDataException exception]; + #if SIZE_MAX >= UINT64_MAX if (length > UINT64_MAX) @throw [OFOutOfRangeException exception]; #endif