]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - compress_filter.c
Fix a bug in the compress filter in case of odd buffer sizes.
[paraslash.git] / compress_filter.c
index 7c392746c5c1e02bc03408876e8af65f1a8118da..a0b53bde61a093b7c9a07595df6af51a8cc1cb65 100644 (file)
@@ -103,13 +103,17 @@ static void compress_post_select(__a_unused struct sched *s, struct task *t)
        //inplace = false;
 next_buffer:
        t->error = 0;
-       ret = btr_node_status(btrn, fn->min_iqs);
+       ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);
        if (ret < 0)
                goto err;
        if (ret == 0)
                return;
        btr_merge(btrn, fn->min_iqs);
        length = btr_next_buffer(btrn, &inbuf) & ~(size_t)1;
+       if (length == 0) { /* eof and 1 byte available */
+               ret = -E_COMPRESS_EOF;
+               goto err;
+       }
        ip = (int16_t *)inbuf;
        if (inplace)
                op = ip;