diff --git a/fsst.h b/fsst.h index 71085d5..e31ec61 100644 --- a/fsst.h +++ b/fsst.h @@ -136,7 +136,7 @@ fsst_compress( size_t outsize, /* IN: byte-length of output buffer. */ unsigned char *output, /* OUT: memory buffer to put the compressed strings in (one after the other). */ size_t lenOut[], /* OUT: byte-lengths of the compressed strings. */ - unsigned char *strOut[] /* OUT: output string start pointers. Will all point into [output,output+size). */ + unsigned char *strOut[] /* OUT: output string start pointers. Will all point into [output,output+size). Can be NULL. */ ); /* Decompress a single string, inlined for speed. */ diff --git a/libfsst.cpp b/libfsst.cpp index e3ba787..b3eeb62 100644 --- a/libfsst.cpp +++ b/libfsst.cpp @@ -257,7 +257,7 @@ static inline size_t compressSIMD(SymbolTable &symbolTable, u8* symbolBase, size if (((len[curLine]-curOff)*2 + 7) > budget) break; // see below for the +7 else budget -= (len[curLine]-curOff)*2; - strOut[curLine] = (u8*) 0; + if (strOut) strOut[curLine] = (u8*) 0; lenOut[curLine] = 0; do { @@ -361,7 +361,7 @@ static inline size_t compressSIMD(SymbolTable &symbolTable, u8* symbolBase, size for(size_t i=0; i