From 7707f053389f2c4ef8491be611d32615eb529f73 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 22 Oct 2015 12:14:43 +0300 Subject: COMMON: Throw a warning on inconsistent DCL fixed size buffers This is useful for debugging, and needed for fixes in Russian fan made translations of The Neverhood Chronicles --- common/dcl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/dcl.cpp b/common/dcl.cpp index 5993c218cb..66dfb76b2a 100644 --- a/common/dcl.cpp +++ b/common/dcl.cpp @@ -449,6 +449,8 @@ bool DecompressorDCL::unpack(SeekableReadStream *sourceStream, WriteStream *targ } if (_targetFixedSize) { + if (_bytesWritten != _targetSize) + warning("DCL-INFLATE Error: Inconsistent bytes written (%d) and target buffer size (%d)", _bytesWritten, _targetSize); return _bytesWritten == _targetSize; } return true; // For targets featuring dynamic size we always succeed -- cgit v1.2.3