]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
error when not using --stream-size on pipe
authorBimba Shrestha <bimbashrestha@fb.com>
Thu, 18 Jun 2020 16:31:06 +0000 (09:31 -0700)
committerBimba Shrestha <bimbashrestha@fb.com>
Thu, 18 Jun 2020 16:31:06 +0000 (09:31 -0700)
programs/fileio.c

index 390e8def5d2450a04b5518ebc685ee3c97458706..5e9d622f911b805f4c90d292099e4163e9c31d78 100644 (file)
@@ -772,6 +772,8 @@ static void FIO_adjustMemLimitForPatchFromMode(FIO_prefs_t* const prefs,
 {
     unsigned long long maxSize = MAX(prefs->memLimit, MAX(dictSize, maxSrcFileSize));
     unsigned const maxWindowSize = (1U << ZSTD_WINDOWLOG_MAX);
+    if (maxSize == UTIL_FILESIZE_UNKNOWN)
+        EXM_THROW(42, "Using --patch-from with stdin requires --stream-size");
     assert(maxSize != UTIL_FILESIZE_UNKNOWN);
     if (maxSize > maxWindowSize)
         EXM_THROW(42, "Can't handle files larger than %u GB\n", maxWindowSize/(1 GB));