summaryrefslogtreecommitdiff
path: root/zdeflate.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-12-19 19:31:45 -0500
committerJeffrey Walton <noloader@gmail.com>2015-12-19 19:31:45 -0500
commit28a5fead3b25d9a00871d6fe8ffe970116956300 (patch)
tree21b1ab26590720d632ba8b6a18d7c65d7a32265a /zdeflate.cpp
parentd1ae977256986f0525ad1cc0427db1857d94b712 (diff)
downloadcryptopp-git-28a5fead3b25d9a00871d6fe8ffe970116956300.tar.gz
Fixed assert. Thanks to srwinohio for reporting (Issue 83)
Diffstat (limited to 'zdeflate.cpp')
-rw-r--r--zdeflate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/zdeflate.cpp b/zdeflate.cpp
index fea6025c..9643d5d7 100644
--- a/zdeflate.cpp
+++ b/zdeflate.cpp
@@ -588,7 +588,7 @@ void Deflator::MatchFound(unsigned int distance, unsigned int length)
assert(m_matchBufferEnd < m_matchBuffer.size());
EncodedMatch &m = m_matchBuffer[m_matchBufferEnd++];
- assert(length >= 3 && length < COUNTOF(lengthCodes));
+ assert((length >= 3) && (length-3 < COUNTOF(lengthCodes)));
unsigned int lengthCode = lengthCodes[length-3];
m.literalCode = lengthCode;
m.literalExtra = length - lengthBases[lengthCode-257];