diff --git a/r5dev/tier1/lzss.cpp b/r5dev/tier1/lzss.cpp index d9f9f39e..761dd94f 100644 --- a/r5dev/tier1/lzss.cpp +++ b/r5dev/tier1/lzss.cpp @@ -330,7 +330,7 @@ unsigned int CLZSS::SafeUncompress( unsigned char *pInput, unsigned char *pOutpu break; } - if ( position > totalBytes || // out of bounds + if ( position + 1 > totalBytes || // out of bounds totalBytes + count > unBufSize ) { return 0;