From a5489f16b6def71ff0e526ab3de6dce0b72ddc35 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 5 Apr 2023 22:58:26 +0200 Subject: [PATCH] Fix small oversight Should be '+1' as 'position' could be 0. --- r5dev/tier1/lzss.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;