aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/simple/simple_coder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/liblzma/simple/simple_coder.c')
-rw-r--r--src/liblzma/simple/simple_coder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/simple/simple_coder.c b/src/liblzma/simple/simple_coder.c
index 9e7bc289..a02b039a 100644
--- a/src/liblzma/simple/simple_coder.c
+++ b/src/liblzma/simple/simple_coder.c
@@ -107,7 +107,7 @@ simple_code(lzma_coder *coder, lzma_allocator *allocator,
// filtered if the buffer sizes used by the application are reasonable.
const size_t out_avail = out_size - *out_pos;
const size_t buf_avail = coder->size - coder->pos;
- if (out_avail > buf_avail) {
+ if (out_avail > buf_avail || buf_avail == 0) {
// Store the old position so that we know from which byte
// to start filtering.
const size_t out_start = *out_pos;