diff options
Diffstat (limited to 'C/LzmaEnc.c')
-rw-r--r-- | C/LzmaEnc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/C/LzmaEnc.c b/C/LzmaEnc.c index b04a7b7..c8b31a1 100644 --- a/C/LzmaEnc.c +++ b/C/LzmaEnc.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* LzmaEnc.c -- LZMA Encoder | 1 | /* LzmaEnc.c -- LZMA Encoder |
2 | 2021-11-18: Igor Pavlov : Public domain */ | 2 | 2022-07-15: Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
5 | 5 | ||
@@ -2970,6 +2970,7 @@ const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) | |||
2970 | } | 2970 | } |
2971 | 2971 | ||
2972 | 2972 | ||
2973 | // (desiredPackSize == 0) is not allowed | ||
2973 | SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, | 2974 | SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, |
2974 | Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) | 2975 | Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) |
2975 | { | 2976 | { |
@@ -2990,14 +2991,10 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, | |||
2990 | if (reInit) | 2991 | if (reInit) |
2991 | LzmaEnc_Init(p); | 2992 | LzmaEnc_Init(p); |
2992 | LzmaEnc_InitPrices(p); | 2993 | LzmaEnc_InitPrices(p); |
2993 | |||
2994 | nowPos64 = p->nowPos64; | ||
2995 | RangeEnc_Init(&p->rc); | 2994 | RangeEnc_Init(&p->rc); |
2996 | p->rc.outStream = &outStream.vt; | 2995 | p->rc.outStream = &outStream.vt; |
2997 | 2996 | nowPos64 = p->nowPos64; | |
2998 | if (desiredPackSize == 0) | 2997 | |
2999 | return SZ_ERROR_OUTPUT_EOF; | ||
3000 | |||
3001 | res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize); | 2998 | res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize); |
3002 | 2999 | ||
3003 | *unpackSize = (UInt32)(p->nowPos64 - nowPos64); | 3000 | *unpackSize = (UInt32)(p->nowPos64 - nowPos64); |