Index: apps/buffering.c =================================================================== --- apps/buffering.c (revision 29093) +++ apps/buffering.c (working copy) @@ -679,7 +679,7 @@ * If this is true, then there's a handle even though we have still * data to buffer. This should NEVER EVER happen! (but it does :( ) */ if (h->next && (overlap - = ringbuf_add_cross(h->widx, copy_n, next_handle)) > 0) + = ringbuf_add_cross(h->widx, copy_n, next_handle)) >= 0) { /* stop buffering data for now and post-pone buffering the rest */ stop = true; @@ -687,7 +687,11 @@ " copy_n:%lu overlap:%ld h1.filerem:%lu\n", __func__, h->id, h->next->id, (unsigned long)copy_n, (long)overlap, (unsigned long)h->filerem); - copy_n -= overlap; + if (overlap == (ssize_t)copy_n) { + DEBUGF("%u: buffer_handle(%d): READ NOTHING\n", thread_get_current(), handle_id); + return false; + } + copy_n -= overlap + 1; } /* rc is the actual amount read */