Fix a dumb bug in Block decoder, which made it return
LZMA_DATA_ERROR with valid data. The bug was added in
e114502b2b
.
This commit is contained in:
parent
c81f13ff29
commit
2c5fe958e4
|
@ -131,15 +131,15 @@ block_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||||
case SEQ_PADDING:
|
case SEQ_PADDING:
|
||||||
// Compressed Data is padded to a multiple of four bytes.
|
// Compressed Data is padded to a multiple of four bytes.
|
||||||
while (coder->compressed_size & 3) {
|
while (coder->compressed_size & 3) {
|
||||||
|
if (*in_pos >= in_size)
|
||||||
|
return LZMA_OK;
|
||||||
|
|
||||||
// We use compressed_size here just get the Padding
|
// We use compressed_size here just get the Padding
|
||||||
// right. The actual Compressed Size was stored to
|
// right. The actual Compressed Size was stored to
|
||||||
// coder->block already, and won't be modified by
|
// coder->block already, and won't be modified by
|
||||||
// us anymore.
|
// us anymore.
|
||||||
++coder->compressed_size;
|
++coder->compressed_size;
|
||||||
|
|
||||||
if (*in_pos >= in_size)
|
|
||||||
return LZMA_OK;
|
|
||||||
|
|
||||||
if (in[(*in_pos)++] != 0x00)
|
if (in[(*in_pos)++] != 0x00)
|
||||||
return LZMA_DATA_ERROR;
|
return LZMA_DATA_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue