Fix decoding of Extra Records that have empty Data.

This commit is contained in:
Lasse Collin 2008-01-23 23:35:49 +02:00
parent e5fdec93e2
commit 3a7cc5c3de

View File

@ -356,7 +356,18 @@ process(lzma_coder *coder, lzma_allocator *allocator)
case SEQ_EXTRA_SIZE:
case SEQ_EXTRA_DUMMY_SIZE:
read_vli(coder->tmp);
if (coder->tmp == 0) {
// We have no Data in the Extra Record. Don't
// allocate any memory for it. Go back to
// SEQ_EXTRA_ALLOC or SEQ_EXTRA_DUMMY_ALLOC.
coder->tmp = 0;
coder->sequence -= 2;
coder->todo_count = 0;
} else {
++coder->sequence;
}
break;
case SEQ_EXTRA_DATA_ALLOC: {