summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/lz4frame.c6
-rw-r--r--programs/frametest.c2
-rw-r--r--programs/lz4io.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c
index 5f69c95..474b196 100644
--- a/lib/lz4frame.c
+++ b/lib/lz4frame.c
@@ -1088,8 +1088,10 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext,
doAnotherStage = 0; /* not enough src data, ask for some more */
break;
}
- LZ4F_errorCode_t errorCode = LZ4F_decodeHeader(dctxPtr, dctxPtr->header, dctxPtr->tmpInTarget);
- if (LZ4F_isError(errorCode)) return errorCode;
+ {
+ LZ4F_errorCode_t errorCode = LZ4F_decodeHeader(dctxPtr, dctxPtr->header, dctxPtr->tmpInTarget);
+ if (LZ4F_isError(errorCode)) return errorCode;
+ }
break;
}
diff --git a/programs/frametest.c b/programs/frametest.c
index 96d5acb..4beee23 100644
--- a/programs/frametest.c
+++ b/programs/frametest.c
@@ -607,7 +607,7 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
/* create a skippable frame (rare case) */
BYTE* op = (BYTE*)compressedBuffer;
FUZ_writeLE32(op, LZ4F_MAGIC_SKIPPABLE_START + (FUZ_rand(&randState) & 15));
- FUZ_writeLE32(op+4, srcSize);
+ FUZ_writeLE32(op+4, (U32)srcSize);
cSize = srcSize+8;
}
else if ((FUZ_rand(&randState) & 0xF) == 2)
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 34d24bf..02e03c8 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -75,6 +75,10 @@
# define SET_SPARSE_FILE_MODE(file)
#endif
+#if !defined(S_ISREG)
+# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
+#endif
+
/*****************************
* Constants