aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-01-19 22:53:18 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-01-19 22:53:18 +0200
commit2f1a8e8eb898f6c036cde55d153ad348bfab3c00 (patch)
treef81996058a5a21769f8f03a6ed35d3e8d93c9295 /src
parentMove some LZMA2 constants to lzma2_encoder.h so that they (diff)
downloadxz-2f1a8e8eb898f6c036cde55d153ad348bfab3c00.tar.xz
Fix handling of non-fatal errors in lzma_code().
Diffstat (limited to 'src')
-rw-r--r--src/liblzma/common/common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/liblzma/common/common.c b/src/liblzma/common/common.c
index 81f783da..dc43fadd 100644
--- a/src/liblzma/common/common.c
+++ b/src/liblzma/common/common.c
@@ -269,14 +269,21 @@ lzma_code(lzma_stream *strm, lzma_action action)
strm->internal->sequence = ISEQ_RUN;
else
strm->internal->sequence = ISEQ_END;
- break;
+ // Fall through
+
+ case LZMA_NO_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;
break;
default:
// All the other errors are fatal; coding cannot be continued.
+ assert(ret != LZMA_BUF_ERROR);
strm->internal->sequence = ISEQ_ERROR;
break;
}