summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-12-11 06:21:54 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-12-11 06:21:54 (GMT)
commita5358e602a526b844d6872c0b46087044651feb3 (patch)
treec59380f8af6ef5100b6f7f54dc643bea6e9bdbfd /lib
parent6988c248d6eb4537cf6c29f711623fb8a5ca89b7 (diff)
parent7dd50ed2f6ffa036171945d06397ae216380c79c (diff)
downloadlz4-a5358e602a526b844d6872c0b46087044651feb3.zip
lz4-a5358e602a526b844d6872c0b46087044651feb3.tar.gz
lz4-a5358e602a526b844d6872c0b46087044651feb3.tar.bz2
Merge pull request #43 from Cyan4973/devr125
Dev
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index f70ac46..2ed686b 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1,6 +1,6 @@
/*
LZ4 - Fast LZ compression algorithm
- Copyright (C) 2011-2014, Yann Collet.
+ Copyright (C) 2011-2015, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,8 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You can contact the author at :
- - LZ4 source repository : http://code.google.com/p/lz4/
+ - LZ4 source repository : http://code.google.com/p/lz4
+ - LZ4 source mirror : https://github.com/Cyan4973/lz4
- LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
*/
@@ -109,6 +110,7 @@
# define FORCE_INLINE static __forceinline
# include <intrin.h>
# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+# pragma warning(disable : 4293) /* disable: C4293: too large shift (32-bits) */
#else
# ifdef __GNUC__
# define FORCE_INLINE static inline __attribute__((always_inline))
@@ -640,10 +642,10 @@ _next_match:
ip += MINMATCH + matchLength;
}
+ if ((outputLimited) && (unlikely(op + (1 + LASTLITERALS) + (matchLength>>8) > olimit)))
+ return 0; /* Check output limit */
if (matchLength>=ML_MASK)
{
- if ((outputLimited) && (unlikely(op + (1 + LASTLITERALS) + (matchLength>>8) > olimit)))
- return 0; /* Check output limit */
*token += ML_MASK;
matchLength -= ML_MASK;
for (; matchLength >= 510 ; matchLength-=510) { *op++ = 255; *op++ = 255; }