1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

Fix handling of non-fatal errors in lzma_code().

This commit is contained in:
Lasse Collin 2009-01-19 22:53:18 +02:00
parent 4810b6bc25
commit 2f1a8e8eb8

View file

@ -269,14 +269,21 @@ lzma_code(lzma_stream *strm, lzma_action action)
strm->internal->sequence = ISEQ_RUN; strm->internal->sequence = ISEQ_RUN;
else else
strm->internal->sequence = ISEQ_END; strm->internal->sequence = ISEQ_END;
break;
// Fall through
case LZMA_NO_CHECK:
case LZMA_UNSUPPORTED_CHECK: case LZMA_UNSUPPORTED_CHECK:
case LZMA_GET_CHECK:
case LZMA_MEMLIMIT_ERROR:
// Something else than LZMA_OK, but not a fatal error,
// that is, coding may be continued (except if ISEQ_END).
strm->internal->allow_buf_error = false; strm->internal->allow_buf_error = false;
break; break;
default: default:
// All the other errors are fatal; coding cannot be continued. // All the other errors are fatal; coding cannot be continued.
assert(ret != LZMA_BUF_ERROR);
strm->internal->sequence = ISEQ_ERROR; strm->internal->sequence = ISEQ_ERROR;
break; break;
} }