Don't create dict in streaming apis if dictSize == 0

This commit is contained in:
Sean Purcell
2017-01-17 14:31:35 -08:00
parent 123c8a3cb8
commit 57d423c5df
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -2951,7 +2951,7 @@ size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs,
if (zcs->outBuff == NULL) return ERROR(memory_allocation);
}
if (dict) {
if (dict && dictSize >= 8) {
ZSTD_freeCDict(zcs->cdictLocal);
zcs->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize, 0, params, zcs->customMem);
if (zcs->cdictLocal == NULL) return ERROR(memory_allocation);