diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libarchive/decompress_unlzma.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/archival/libarchive/decompress_unlzma.c b/archival/libarchive/decompress_unlzma.c index be4342414..80a453806 100644 --- a/archival/libarchive/decompress_unlzma.c +++ b/archival/libarchive/decompress_unlzma.c | |||
@@ -11,6 +11,13 @@ | |||
11 | #include "libbb.h" | 11 | #include "libbb.h" |
12 | #include "bb_archive.h" | 12 | #include "bb_archive.h" |
13 | 13 | ||
14 | #if 0 | ||
15 | # define dbg(...) bb_error_msg(__VA_ARGS__) | ||
16 | #else | ||
17 | # define dbg(...) ((void)0) | ||
18 | #endif | ||
19 | |||
20 | |||
14 | #if ENABLE_FEATURE_LZMA_FAST | 21 | #if ENABLE_FEATURE_LZMA_FAST |
15 | # define speed_inline ALWAYS_INLINE | 22 | # define speed_inline ALWAYS_INLINE |
16 | # define size_inline | 23 | # define size_inline |
@@ -417,6 +424,10 @@ unpack_lzma_stream(transformer_state_t *xstate) | |||
417 | for (; num_bits2 != LZMA_NUM_ALIGN_BITS; num_bits2--) | 424 | for (; num_bits2 != LZMA_NUM_ALIGN_BITS; num_bits2--) |
418 | rep0 = (rep0 << 1) | rc_direct_bit(rc); | 425 | rep0 = (rep0 << 1) | rc_direct_bit(rc); |
419 | rep0 <<= LZMA_NUM_ALIGN_BITS; | 426 | rep0 <<= LZMA_NUM_ALIGN_BITS; |
427 | if ((int32_t)rep0 < 0) { | ||
428 | dbg("%d rep0:%d", __LINE__, rep0); | ||
429 | goto bad; | ||
430 | } | ||
420 | prob3 = p + LZMA_ALIGN; | 431 | prob3 = p + LZMA_ALIGN; |
421 | } | 432 | } |
422 | i2 = 1; | 433 | i2 = 1; |