From 6d985c0b986952c562469a5ec15a6a948222fece Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 11 Apr 2015 17:01:02 -0700 Subject: [PATCH] Fix over-read error near end of some CSOs. This was only a problem for larger-than-2048 block CSOs when reading them, and would cause an error to be shown. --- src/compress.h | 2 +- src/input.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compress.h b/src/compress.h index 8282e3fbe..21fe50ee9 100644 --- a/src/compress.h +++ b/src/compress.h @@ -7,7 +7,7 @@ namespace maxcso { -static const char *VERSION = "1.4.5"; +static const char *VERSION = "1.4.6"; struct Task; diff --git a/src/input.cpp b/src/input.cpp index 1f9718ea6..4ba604b28 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -237,6 +237,7 @@ void Input::ReadSector() { if (!compressedDeflate && !compressedLZ4 && offset != 0) { pos += offset; + len -= offset; offset = 0; } } @@ -251,6 +252,7 @@ void Input::ReadSector() { if (!compressedDeflate && offset != 0) { pos += offset; + len -= offset; offset = 0; } }