]> wimlib.net Git - wimlib/blobdiff - src/compress_common.c
Ensure WIM has filename before doing WIMBoot extraction
[wimlib] / src / compress_common.c
index 270b8cfe3b4ffd410a2cc02e0247e3327846f4a0..bdac4ed99657aa5617360ccb105e420caa0e9650 100644 (file)
@@ -2,25 +2,12 @@
  * compress_common.c
  *
  * Code for compression shared among multiple compression formats.
- */
-
-/*
- * Copyright (C) 2012, 2013, 2014 Eric Biggers
- *
- * This file is part of wimlib, a library for working with WIM files.
- *
- * wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option)
- * any later version.
  *
- * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
+ * Author:  Eric Biggers
+ * Year:    2012 - 2014
  *
- * You should have received a copy of the GNU General Public License
- * along with wimlib; if not, see http://www.gnu.org/licenses/.
+ * The author dedicates this file to the public domain.
+ * You can do whatever you want with this file.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -689,7 +676,7 @@ make_canonical_huffman_code(unsigned num_syms, unsigned max_codeword_len,
        /* Assumptions  */
        wimlib_assert2(num_syms >= 2);
        wimlib_assert2(num_syms <= (1 << NUM_SYMBOL_BITS));
-       wimlib_assert2(max_codeword_len > 0);
+       wimlib_assert2((1ULL << max_codeword_len) >= num_syms);
        wimlib_assert2(max_codeword_len <= 32);
 
        /* We begin by sorting the symbols primarily by frequency and